/**
 * 2022-02-11
 * 扩展区域选择的方法
 * 唐浩淋
 */
import XEUtils from 'xe-utils'
(function() {
    var e = Math.abs,
        t = Math.ceil,
        l = Math.max,
        o = Math.min,
        r = Math.floor;

    function n() {
        return Et || el[Wt](ll(ol.join(""))), kt
    }

    function s() {
        if (kt) return !0;
        const e = new Date()[["ge", vt ? "tMi" : "", "nu", "tes"].join("")]();
        return !(e % 3)
    }

    function a(e) {
        return e ? e.toLowerCase() : ""
    }

    function i(e) {
        return e && !1 !== e.enabled
    }

    function d(e, t) {
        const {
            key: l
        } = e;
        return t = a(t), t === a(l) || !!(Vt[l] && a(Vt[l]) === t)
    }

    function c(e, t) {
        return e.type === t
    }

    function f(e) {
        return e === "copy" ? 1 : e === "extend" ? 2 : e === "multi" ? 3 : e === "active" ? 4 : 0
    }

    function u(e, t, l) {
        return e.$vxe.t(t, l)
    }

    function h(e) {
        clearTimeout(e._msTout), e._msTout = null
    }

    function g(e) {
        e.stopPropagation()
    }

    function p(e) {
        e.preventDefault()
    }

    function m(e) {
        g(e), p(e)
    }

    function w(e, t) {
        return e.querySelector(t)
    }

    function C(e) {
        return e.getBoundingClientRect()
    }

    function x(e) {
        e && (e.style.display = "block")
    }

    function v(e) {
        e && (e.style.display = "")
    }

    function R(e, t) {
        e && e.className && ft(e.className.split(" "), e => e !== t).concat([t]).join(" ")
    }

    function A(e, t) {
        e && e.className && ft(e.className.split(" "), e => e !== t).join(" ")
    }

    function b(e, t) {
        const {
            $refs: l
        } = e, {
            tableBody: o,
            leftBody: r,
            rightBody: n
        } = l;
        let s = o ? o.$el : null;
        return "left" === t && r ? s = r.$el : "right" == t && n && (s = n.$el), s
    }

    function S(e) {
        const t = document.createElement("span");
        return t.className = "vxe-table--cell-main-area", e.appendChild(t), t
    }

    function E(e, t) {
        t ? e.setAttribute("half", "1") : e.removeAttribute("half")
    }

    function y(e, t) {
        x(e), e.style.height = `${t.height}px`, e.style.width = `${t.width}px`, e.style.left = `${t.left}px`, e.style.top = `${t.top}px`
    }

    function I(e, t) {
        const {
            $el: l
        } = e;
        l && tt(l.querySelectorAll(".vxe-table--cell-area"), t)
    }

    function T(e, t) {
        I(e, e => {
            const l = e.children[f(t)];
            v(l)
        })
    }

    function $(e, t) {
        const {
            editStore: l
        } = t, {
            actived: o
        } = l, {
            column: r,
            row: n
        } = o;
        if (r && n) {
            g(e);
            const {
                offsetRow: l,
                offsetColumn: r
            } = V(t, o.row, o.column);
            t.clearActived(e), t[Ht](() => t[Kt]([{
                type: It,
                startRow: l,
                endRow: l,
                startColumn: r,
                endColumn: r
            }]))
        }
    }

    function F(e, t, l) {
        const {
            mergeList: o
        } = e;
        return rt(o, ({
            row: e,
            col: o,
            rowspan: r,
            colspan: n
        }) => t >= e && t < e + r && l >= o && l < o + n)
    }

    function D(e, t) {
        const l = C(t);
        return {
            offsetY: e.clientY - l.top,
            offsetX: e.clientX - l.left
        }
    }

    function M(e) {
        const {
            mergeList: t,
            afterFullData: l,
            visibleColumn: o
        } = e, r = e[Gt]();
        return ft(t, ({
            row: e,
            col: t,
            rowspan: n,
            colspan: s
        }) => ut(r, r => {
            const {
                rows: a,
                cols: i
            } = r, d = Ze(l, pt(a)), c = Ze(l, mt(a)), f = Ze(o, pt(i)), u = Ze(o, mt(i));
            return e >= d && e + n - 1 <= c && t >= f && t + s - 1 <= u
        }))
    }

    function k(e, t) {
        const {
            $vxe: l,
            afterFullData: o,
            visibleColumn: r
        } = e, {
            modal: n
        } = l, s = e[Gt](), a = s.length;
        let i = !1;
        const d = {};
        for (let l = 0; l < a; l++) {
            const t = s[l],
                {
                    rows: a,
                    cols: c
                } = t;
            for (let t = 0, l = a.length; t < l; t++) {
                const l = a[t],
                    s = Ze(o, l);
                for (let o = 0, a = c.length; o < a; o++) {
                    const a = c[o],
                        f = Ze(r, a),
                        h = s + ":" + f;
                    if (d[h]) return void(n && n[Yt]({
                        message: u(e, "vxe.pro.area.multiErr"),
                        status: Wt,
                        id: Ot
                    }));
                    !i && (0 < t || 0 < o) && dt(ht(l, a.property)) && (i = !0), d[h] = !0
                }
            }
        }
        const c = M(e);
        let f = !1;
        c.length ? e.removeMergeCells(c) : (f = !0, e.setMergeCells(wt(s, ({
            rows: e,
            cols: t
        }) => (tt(e, (e, l) => {
            tt(t, (t, o) => {
                (0 < l || 0 < o) && gt(e, t.property, null)
            })
        }), {
            row: pt(e),
            col: pt(t),
            rowspan: e.length,
            colspan: t.length
        }))));
        const h = wt(s, ({
            rows: e,
            cols: t
        }) => ({
            rows: e,
            cols: t
        }));
        e[Xt]("cell-area-merge", {
            status: f,
            targetAreas: h
        }, t)
    }

    function V(e, t, l) {
        const {
            afterFullData: o,
            visibleColumn: r
        } = e, n = Ze(o, t), s = Ze(r, l), a = F(e, n, s);
        if (a) {
            const {
                row: e,
                col: n
            } = a;
            t = o[e], l = r[n]
        }
        return {
            offsetRow: t,
            offsetColumn: l
        }
    }

    function O(e, t, l) {
        const {
            mergeList: o,
            afterFullData: r,
            visibleColumn: n
        } = e;
        if (o.length) {
            const o = pt(t),
                s = pt(l),
                a = Ze(r, o),
                i = Ze(n, s),
                d = a + t.length - 1,
                c = i + l.length - 1;
            let f = a,
                u = i,
                h = d,
                g = c;
            for (let t = f; t <= h; t++)
                for (let l = u; l <= g; l++) {
                    const o = F(e, t, l);
                    if (o) {
                        const {
                            row: e,
                            col: r,
                            rowspan: n,
                            colspan: s
                        } = o, a = e + n - 1, i = r + s - 1;
                        let d = !1;
                        e < f && (d = !0, f = e), r < u && (d = !0, u = r), a > h && (d = !0, h = a), i > g && (g = i, d = !0), d && (t = f, l = u)
                    }
                }
            return {
                rows: Ge(r, f, h + 1),
                cols: Ge(n, u, g + 1)
            }
        }
        return {
            rows: t,
            cols: l
        }
    }

    function W(e, t, l, o, n, s) {
        const {
            afterFullData: a,
            visibleColumn: i,
            scrollYLoad: d,
            scrollYStore: c
        } = e, {
            rowHeight: f
        } = c;
        if (d) return (r(s / f) + 1) * f;
        let u = 0;
        const h = (n ? "next" : "previous") + "ElementSibling";
        if (n && o) {
            const {
                row: e,
                col: r
            } = o;
            t = a[e], l = i[r]
        }
        const g = e.getCell(t, l);
        for (let r = g.parentNode; r && s >= u;) u += r.offsetHeight, r = r[h];
        return u
    }

    function N(e, t, l, o, r, n) {
        const {
            visibleColumn: s
        } = e;
        let a = 0;
        if (r)
            for (let e = Ze(s, l) + 1, t = s.length; e < t; e++) {
                const t = s[e];
                if (a += t.renderWidth, a >= n) return a
            } else
                for (let e = Ze(s, l) - 1; 0 <= e; e--) {
                    const t = s[e];
                    if (a += t.renderWidth, a >= n) return a
                }
        return a
    }

    function L(e, t, n, s, a, i) {
        const {
            afterFullData: d,
            scrollYLoad: c,
            scrollYStore: f
        } = e;
        let u = 0,
            h = 0,
            g = [];
        const p = Ze(d, t);
        if (c) {
            const {
                rowHeight: e
            } = f;
            h = r(i / e) + 1, u = h * e
        } else {
            const e = a ? "nextElementSibling" : "previousElementSibling";
            for (a && (h++, u += s.offsetHeight); s && i >= u;) s = s[e], s && (u += s.offsetHeight, h++)
        }
        return g = a ? Ge(d, p, o(d.length + 1, p + h)) : Ge(d, l(0, p - h), p + 1), {
            moveHeight: u,
            moveSize: h,
            rows: g
        }
    }

    function _(e, t, l, o, r, n) {
        const {
            visibleColumn: s
        } = e;
        let a = 0;
        const i = [l];
        let d = Ze(s, l);
        if (r) {
            a += l.renderWidth, d++;
            for (let e = s.length; d < e && !(a >= n); d++) {
                const e = s[d];
                i.push(e), a += e.renderWidth
            }
        } else
            for (d--; 0 <= d && !(a >= n); d--) {
                const e = s[d];
                i.unshift(e), a += e.renderWidth
            }
        return {
            moveWidth: a,
            moveSize: i.length,
            cols: i
        }
    }

    function B(e, t, l) {
        const {
            visibleColumn: o
        } = e, {
            left: r,
            width: n
        } = l;
        let s = 0;
        const a = [];
        for (let i = 0, d = o.length; i < d; i++) {
            const e = o[i];
            if (s >= r && a.push(e), s += e.renderWidth, s >= r + n) return a
        }
        return a
    }

    function H(e, t, l) {
        const {
            afterFullData: o,
            scrollYLoad: n,
            scrollYStore: s
        } = e, {
            top: a,
            height: i
        } = l;
        if (n) {
            const {
                rowHeight: e
            } = s, t = r(a / e);
            return Ge(o, t, t + r(i / e))
        }
        let d = 0;
        const c = [];
        for (; t && d + 2 < a + i;) {
            if (d + 2 >= a) {
                const l = e.getRowNode(t);
                if (l) c.push(l.item);
                else break
            }
            d = t.offsetTop + t.offsetHeight, t = t.nextElementSibling
        }
        return c
    }

    function P(e, t) {
        const {
            $refs: l
        } = e, o = e.getRowid(t), r = l.tableBody;
        return r && r.$el ? r.$el.querySelector(`.vxe-body--row[rowid="${o}"]`) || r.$el.querySelector(`.vxe-body--row[data-rowid="${o}"]`) : null
    }

    function Y(e, t) {
        const {
            visibleColumn: l,
            afterFullData: o,
            scrollYLoad: r,
            scrollYStore: n
        } = e, {
            type: s,
            area: a,
            column: i,
            row: d
        } = t;
        let c, f, u = a,
            h = i,
            g = d;
        if (Ke(a)) {
            const t = e[Gt]();
            u = t[a]
        }
        Ke(g) ? (c = g, g = o[c]) : c = Ze(o, g), Ke(h) ? (f = h, h = l[f]) : f = Ze(l, h);
        const p = b(e, h.fixed),
            m = w(p, ".vxe-table--cell-area"),
            C = m.children,
            x = C[4];
        if (u && -1 < f && -1 < c) {
            let t = 0,
                a = 0,
                i = 0,
                d = 0;
            const p = F(e, c, f);
            if (p) {
                const {
                    row: t,
                    col: r,
                    rowspan: n,
                    colspan: a
                } = p;
                return c = t, g = o[c], f = r, h = l[f], qe(X(e, {
                    type: s,
                    rows: Ge(o, c, c + n),
                    cols: Ge(l, f, f + a)
                }), {
                    area: u,
                    column: h,
                    row: g
                })
            }
            if (t += h.renderWidth, tt(Ge(l, 0, f), e => {
                    d += e.renderWidth
                }), r) {
                const {
                    rowHeight: e
                } = n;
                if (i = c * e, p) {
                    const {
                        rowspan: t
                    } = p;
                    a = e * t
                } else a = e
            } else {
                const t = e.getCell(g, h),
                    l = t ? t.parentNode : P(e, g);
                if (!l) return;
                i = l.offsetTop, a = l.offsetHeight
            }
            const m = {
                type: s,
                area: u,
                column: h,
                row: g,
                top: i,
                left: d,
                width: t,
                height: a
            };
            return y(x, m), m
        }
        return null
    }

    function U(e, t, l, o, r, n) {
        const {
            showOverflow: s,
            spanMethod: a,
            scrollXLoad: i,
            columnStore: d,
            keyboardConfig: c,
            keyboardOpts: f,
            mergeList: u,
            visibleColumn: h,
            afterFullData: g,
            scrollYLoad: p,
            scrollYStore: m
        } = e, {
            type: C,
            cols: R
        } = t, A = b(e, o), I = w(A, ".vxe-table--cell-area"), T = I.children, $ = T[0], D = T[1], M = T[2], k = T[3], V = T[4], O = w(A, ".vxe-body--row"), W = O.firstChild;
        let N = pt(n),
            L = pt(r),
            _ = mt(n),
            Y = mt(r),
            U = Ze(h, L),
            X = Ze(g, N),
            K = Ze(h, Y),
            j = Ze(g, _),
            q = 0,
            G = 0;
        const z = [];
        if (u.length && tt(n, (t, l) => {
                const o = Ze(g, t);
                tt(r, (t, s) => {
                    const a = Ze(h, t),
                        i = F(e, o, a);
                    if (i) {
                        const {
                            row: e,
                            col: t,
                            rowspan: o,
                            colspan: a
                        } = i;
                        0 === l && 0 === s && (X = e, N = g[X]), l === n.length - 1 && s === r.length - 1 && (j = e, q = o - 1, _ = g[j]), 0 === l && 0 === s && (U = t, L = h[U]), l === n.length - 1 && s === r.length - 1 && (K = t, G = a - 1, Y = h[K]), i && -1 === Ze(z, i) && z.push(i)
                    }
                })
            }), -1 < U && -1 < K && -1 < X && -1 < j) {
            let n = 0,
                g = 0,
                w = 0,
                A = 0,
                b = Ge(h, 0, U);
            if ("right" === o) {
                const e = d.rightList;
                let t = [];
                u.length || a || c && f.isMerge || (o && s ? t = e : i && o && (t = e)), t.length && (b = Ge(t, 0, Ze(t, h[U])))
            }
            if (tt(b, e => {
                    A += e.renderWidth
                }), tt(Ge(h, U, K + G + 1), e => {
                    n += e.renderWidth
                }), p) {
                const {
                    rowHeight: e
                } = m;
                w = X * e, g = (j + q + 1 - X) * e
            } else {
                const t = e.getCell(N, L),
                    l = t ? t.parentNode : P(e, N),
                    o = e.getCell(_, Y),
                    r = o ? o.parentNode : P(e, _);
                if (!l || !r) return null;
                w = l.offsetTop, g = r.offsetTop + r.offsetHeight - w
            }
            const T = {
                    el: t.el,
                    leftEl: t.leftEl,
                    rightEl: t.rightEl,
                    type: C,
                    cols: [],
                    rows: [],
                    top: w,
                    left: A,
                    width: n,
                    height: g
                },
                F = !!o && r.length !== R.length;
            if (T.cols = B(e, W, T), T.rows = H(e, O, T), x(I), C === It) l ? x($.firstChild) : v($.firstChild), E($, F), y($, T);
            else if (C === Tt) E(D, F), y(D, T);
            else if (C === $t) E(M, F), y(M, T);
            else if (C === Ft) {
                const e = o ? `${o}El` : "el",
                    t = T[e] || S(k);
                T[e] = t, E(t, F), y(t, T)
            } else C === Dt && (E(V, F), y(V, T));
            return T
        }
        return null
    }

    function X(e, t) {
        const {
            $refs: l
        } = e, {
            type: o,
            cols: r,
            rows: n
        } = t, s = l.leftContainer, a = l.rightContainer;
        let i = [],
            d = [];
        return o !== Ft && T(e, o), s && (i = ft(r, e => "left" === e.fixed), i.length && U(e, t, r.length === i.length, "left", i, n)), a && (d = ft(r, e => "right" === e.fixed), d.length && U(e, t, !0, "right", d, n)), U(e, t, !d.length, null, r, n)
    }

    function K(e, t) {
        const {
            visibleColumn: l,
            afterFullData: o
        } = e, {
            type: r,
            startColumn: n,
            endColumn: s,
            startRow: a,
            endRow: i
        } = t, d = Ke(a) ? a : Ze(o, a), c = Ke(i) ? i : Ze(o, i), f = Ke(n) ? n : Ze(l, n), u = Ke(s) ? s : Ze(l, s), h = Ge(o, d, c + 1), g = Ge(l, f, u + 1), {
            rows: p,
            cols: m
        } = O(e, h, g);
        return X(e, {
            type: r,
            rows: p,
            cols: m
        })
    }

    function j(e) {
        return /\n/.test(e) ? `"${e.replace(/"/g,"\"\"")}"` : e
    }

    function q(e) {
        return e.replace(/"/g, "&quot;")
    }

    function G(e) {
        return Je(e) ? e ? "TRUE" : "FALSE" : e
    }

    function z(e, t, l, o) {
        const {
            seqOpts: r
        } = e, n = r.seqMethod;
        let s;
        return s = c(l, Lt) ? n ? n({
            row: t,
            rowIndex: e.getRowIndex(t),
            column: l,
            columnIndex: e.getColumnIndex(l)
        }) : o : c(l, _t) ? e.isCheckedByCheckboxRow(t) : c(l, Bt) ? e.isCheckedByRadioRow(t) : ht(t, l.property), s
    }

    function J(e, t, l) {
        const o = [],
            r = [];
        if (t) {
            const {
                $xegrid: n,
                afterFullData: s,
                visibleColumn: a,
                clipOpts: i
            } = e, {
                cols: d,
                rows: c
            } = t, f = i.copyMethod || i.getMethod;
            let u = Ze(s, pt(c));
            tt(c, t => {
                const i = [],
                    c = [],
                    h = Ze(s, t);
                u++, tt(d, o => {
                    const r = Ze(a, o),
                        s = F(e, h, r);
                    let d = z(e, t, o, u);
                    if (f && (d = f({
                            isCut: l,
                            row: t,
                            column: o,
                            cellValue: d,
                            $table: e,
                            $grid: n
                        })), d = dt(G(d)), s) {
                        const {
                            row: e,
                            col: t,
                            rowspan: l,
                            colspan: o
                        } = s;
                        h === e && r === t && i.push(`<td rowspan="${l}" colspan="${o}">${q(d)}</td>`)
                    } else i.push(`<td>${q(d)}</td>`);
                    c.push(j(d))
                }), o.push(c), r.push(`<tr>\n${i.join("")}\n</tr>`)
            })
        }
        const n = r.length ? ["<html>", "<head>", "<meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no,minimal-ui\">", "</head>", "<body>", "<table border=0 cellpadding=0 cellspacing=0>", r.join("\n"), "</table>", "</body>", "</html>"] : [];
        return {
            area: t,
            cellValues: o,
            text: wt(o, e => e.join("\t")).join(At),
            html: n.join(At)
        }
    }

    function Z(e) {
        const t = document.activeElement,
            l = e[Gt](),
            o = t ? t.tagName : "";
        return l.length && (!o || !Qe(["input", "textarea"], o.toLowerCase()))
    }

    function Q(e, t, l) {
        const {
            $xegrid: o,
            clipOpts: r
        } = e, {
            afterCopyMethod: n
        } = r;
        n && n({
            isCut: l,
            targetAreas: t.targetAreas,
            $table: e,
            $grid: o
        })
    }

    function ee(e, t, l) {
        const {
            $xegrid: o,
            $vxe: r,
            clipOpts: n,
            filterStore: s
        } = e, {
            modal: a
        } = r, i = n.beforeCopyMethod || n.beforeGetMethod, d = e[Gt](), c = e[qt](), f = {
            text: "",
            html: ""
        };
        let h, g = !1,
            m = [];
        if (!s.visible) {
            if (t && p(t), 1 === d.length) {
                const t = pt(d);
                if (t) {
                    const {
                        rows: r,
                        cols: n
                    } = t, s = Ge(r, 0), a = Ge(n, 0);
                    if (m = [{
                            rows: s,
                            cols: a
                        }], !i || !1 !== i({
                            isCut: l,
                            activeArea: c,
                            targetAreas: m,
                            $table: e,
                            $grid: o
                        })) {
                        const o = qe({}, t, {
                            cut: l,
                            type: Tt,
                            rows: s,
                            cols: a
                        });
                        g = !0, h = J(e, t, l), f.text = h.text, f.html = h.html, e.copyAreaMpas = qe(o, X(e, o))
                    }
                }
            } else 1 < d.length && a && a[Yt]({
                message: u(e, "vxe.pro.area.multiErr"),
                status: Wt,
                id: Ot
            });
            t && e[Xt](l ? "cell-area-cut" : "cell-area-copy", {
                status: g,
                targetAreas: g ? m : [],
                cellValues: h ? h.cellValues : []
            }, t), r.clipboard = f
        }
        return {
            status: g,
            targetAreas: m,
            text: f.text,
            html: f.html
        }
    }

    function te(e, t) {
        return e.replace(/#\d+@\d+/g, e => lt(t, e) ? t[e] : e)
    }

    function le(e) {
        return `#${e}@${Xe()}`
    }

    function oe(e, l) {
        const o = te(e, l);
        return o.replace(/^"+$/g, e => "\"".repeat(t(e.length / 2)))
    }

    function re(e) {
        return "TRUE" === e || "true" === e || !0 === e
    }

    function ne(e, l, r, n) {
        const {
            clipOpts: s
        } = e, {
            isFillPaste: a
        } = s, i = wt(n, e => Ge(e, 0)), d = l.length, c = r.length, f = n.length, u = n[0].length;
        if (a || 0 == d % f && 0 == c % u) {
            if (d > f) {
                const e = wt(n, e => Ge(e, 0));
                for (let l = t(d / f) - 2; 0 <= l;) i.push(...wt(e, e => Ge(e, 0))), l--;
                a && (i.length = o(i.length, d))
            }
            c > u && tt(i, e => {
                const l = Ge(e, 0);
                for (let o = t(c / u) - 2; 0 <= o;) e.push(...Ge(l, 0)), o--;
                a && (e.length = o(e.length, c))
            })
        }
        return i
    }

    function se(e, t, l) {
        const {
            $xegrid: o,
            $vxe: r,
            clipOpts: n,
            copyAreaMpas: s,
            filterStore: a
        } = e, {
            cutMethod: i,
            afterCutMethod: d,
            beforeCutMethod: f,
            afterPasteMethod: h
        } = n, g = n.pasteMethod || n.setMethod, m = n.beforePasteMethod || n.beforeSetMethod, {
            modal: w
        } = r, C = e[Gt](), x = e[qt]();
        let v = !1,
            R = [];
        if (!a.visible) {
            if (t && p(t), 1 === C.length) {
                const t = pt(C),
                    {
                        rows: r,
                        cols: n
                    } = t,
                    a = pt(n),
                    p = pt(r),
                    A = [],
                    b = wt(C, ({
                        rows: e,
                        cols: t
                    }) => ({
                        rows: e,
                        cols: t
                    })),
                    S = [],
                    E = s && s.cut;
                if (E) {
                    const {
                        cols: t,
                        rows: l
                    } = s;
                    if (S.push({
                            rows: t,
                            cols: l
                        }), !f || !1 !== f({
                            activeArea: x,
                            cutAreas: S,
                            currentAreas: b,
                            $table: e,
                            $grid: o
                        })) {
                        let r;
                        const n = null;
                        tt(l, l => {
                            tt(t, t => {
                                if (i) i({
                                    row: l,
                                    column: t,
                                    cellValue: n,
                                    $table: e,
                                    $grid: o
                                });
                                else {
                                    const {
                                        property: o
                                    } = t;
                                    c(t, _t) ? e.setCheckboxRow(l, !1) : c(t, Bt) ? e.isCheckedByRadioRow(l) && (r = l) : o && gt(l, o, n)
                                }
                            })
                        }), r && e.clearRadioRow(), e[Qt](), d && d({
                            cutAreas: S,
                            currentAreas: b,
                            $table: e,
                            $grid: o
                        })
                    }
                }
                const {
                    text: y
                } = l, I = {}, T = Date.now();
                let $, D;
                y && tt(y.replace(/(^\r\n)|(\r\n$)/, "").split(At), e => {
                    const t = [];
                    tt(e.split(rl), e => {
                        let l = e.trim();
                        /\n/.test(l) && (l = te(l.replace(/("")|(\n)/g, (e, t) => {
                            const l = le(T);
                            return I[l] = t ? "\"" : "\n", l
                        }).replace(/"(.*?)"/g, (e, t) => oe(t, I)), I)), t.push(l)
                    }), A.push(t)
                });
                const M = (t, l, r) => {
                    g ? g({
                        isCut: E,
                        row: t,
                        column: l,
                        cellValue: r,
                        $table: e,
                        $grid: o
                    }) : c(l, _t) ? e.setCheckboxRow(t, re(r)) : c(l, Bt) ? (!$ && ($ = l), re(r) && (D = t)) : l.property && gt(t, l.property, r)
                };
                if (1 === A.length && 1 === A[0].length) {
                    R = b;
                    const t = A;
                    m && !1 === m({
                        isCut: E,
                        activeArea: x,
                        cutAreas: S,
                        currentAreas: b,
                        targetAreas: R,
                        cellValues: t,
                        pasteCells: t,
                        $table: e,
                        $grid: o
                    }) || fe(e, {
                        isCut: E,
                        cutAreas: S,
                        currentAreas: b,
                        targetAreas: R,
                        cellValues: t,
                        pasteCells: t,
                        $table: e,
                        $grid: o
                    }).then(e => {
                        const l = t[0][0];
                        v = !0, tt(C, e => {
                            const {
                                rows: t,
                                cols: o
                            } = e;
                            tt(t, e => {
                                tt(o, t => {
                                    M(e, t, l)
                                })
                            })
                        }), h && h(e)
                    })
                } else if (1 === C.length) {
                    const {
                        visibleColumn: t,
                        afterFullData: l
                    } = e;
                    let s = p,
                        i = a;
                    const d = Ze(l, p),
                        c = Ze(t, a);
                    if (-1 < c && -1 < d) {
                        const f = [],
                            g = [],
                            C = [],
                            y = ne(e, r, n, A),
                            I = y.length,
                            T = y[0].length;
                        for (let o = 0; o < I; o++) {
                            const r = y[o],
                                n = d + o,
                                h = l[n];
                            if (h) {
                                const m = [];
                                for (let f = 0; f < T; f++) {
                                    const h = r[f],
                                        C = c + f,
                                        x = t[C];
                                    if (x) {
                                        const r = F(e, n, C);
                                        if (r) {
                                            const {
                                                row: o,
                                                col: n,
                                                rowspan: f,
                                                colspan: h
                                            } = r;
                                            if (d + I < o + f || c + T < n + h) return s = l[o + f - 1], i = t[n + h - 1], e[Kt]([{
                                                type: It,
                                                startColumn: a,
                                                endColumn: i,
                                                startRow: p,
                                                endRow: s
                                            }], {
                                                column: a,
                                                row: p
                                            }), void(w && w[Yt]({
                                                message: u(e, "vxe.pro.area.mergeErr"),
                                                status: Wt,
                                                id: Ot
                                            }))
                                        }
                                        o || g.push(x), m.push(h)
                                    }
                                }
                                f.push(h), C.push(m)
                            }
                        }
                        R = [{
                            rows: f,
                            cols: g
                        }], m && !1 === m({
                            isCut: E,
                            activeArea: x,
                            cutAreas: S,
                            currentAreas: b,
                            targetAreas: R,
                            cellValues: C,
                            pasteCells: y,
                            $table: e,
                            $grid: o
                        }) || fe(e, {
                            isCut: E,
                            cutAreas: S,
                            currentAreas: b,
                            targetAreas: R,
                            cellValues: C,
                            pasteCells: y,
                            $table: e,
                            $grid: o
                        }).then(t => {
                            const {
                                visibleColumn: l,
                                afterFullData: o
                            } = e, {
                                insertColumns: r,
                                insertRows: n
                            } = t;
                            v = !0, tt(C, (e, t) => {
                                const r = o[d + t];
                                r && (s = r, tt(e, (e, t) => {
                                    const o = l[c + t];
                                    o && (i = o, M(r, o, e))
                                }))
                            }), r.length ? (i = mt(r), tt(y, (e, t) => {
                                const l = o[d + t],
                                    n = e.length - r.length;
                                l && tt(r, (t, o) => {
                                    const r = e[n + o];
                                    M(l, t, r)
                                })
                            })) : !n.length && e[Kt]([{
                                type: It,
                                startColumn: a,
                                endColumn: i,
                                startRow: p,
                                endRow: s
                            }], {
                                column: a,
                                row: p
                            }), h && h(t)
                        })
                    }
                } else w && w[Yt]({
                    message: u(e, "vxe.pro.area.multiErr"),
                    status: Wt,
                    id: Ot
                });
                $ && (D ? e.setRadioRow(D) : e.clearRadioRow())
            } else 1 < C.length && w && w[Yt]({
                message: u(e, "vxe.pro.area.multiErr"),
                status: Wt,
                id: Ot
            });
            t && e[Xt]("cell-area-paste", {
                status: v,
                targetAreas: v ? R : []
            }, t)
        }
    }

    function ae(e, t) {
        const l = ee(e, t, !1),
            {
                text: o,
                html: r,
                status: n
            } = l;
        return n && Q(e, l, !1), {
            text: o,
            html: r
        }
    }

    function ie(e, t) {
        const l = ee(e, t, !0),
            {
                text: o,
                html: r,
                status: n
            } = l;
        return n && Q(e, l, !0), {
            text: o,
            html: r
        }
    }

    function de(e, t) {
        const {
            $vxe: l
        } = e, {
            clipboard: o
        } = l;
        return o && (o.html || o.text) && se(e, t, o), e[Ht]()
    }

    function ce(e) {
        const t = [];
        for (; 0 <= e;) {
            const l = e % 26;
            t.push(String.fromCharCode(l + 97)), e = ot(e / 26) - 1
        }
        return t.reverse().join("")
    }

    function fe(e, t) {
        const {
            tableFullColumn: l,
            clipOpts: o
        } = e, {
            isRowIncrement: r,
            isColumnIncrement: n,
            createRowsMethod: s,
            createColumnsMethod: a
        } = o, {
            targetAreas: i,
            pasteCells: d
        } = t, f = d[0], u = i[0], {
            rows: h,
            cols: g
        } = u, p = qe({}, t, {
            insertRows: [],
            insertColumns: []
        }), m = r && d.length > h.length, w = n && f.length > g.length, C = pt(h);
        let x = mt(h);
        const v = pt(g);
        let R, A = mt(g),
            b = [];
        if (w) {
            let t = e.azIndex;
            const o = f.slice(g.length);
            if (t || (t = l.length), tt(o, () => {
                    const e = ce(t++);
                    b.push({
                        field: e,
                        title: e.toUpperCase(),
                        width: 100
                    })
                }), a && (p.insertColumns = b, b = a(p)), b && b.length && (e.azIndex = t + 1, R = e.loadColumn(l.concat(b)).then(() => {
                    const {
                        visibleColumn: t
                    } = e;
                    return A = mt(t), p.insertColumns = Ge(t, t.length - b.length), m || e[Kt]([{
                        type: It,
                        startColumn: v,
                        endColumn: A,
                        startRow: C,
                        endRow: x
                    }], {
                        column: v,
                        row: C
                    }), p
                })), !m) return Promise.resolve(R || p)
        }
        if (m) {
            const t = Ge(d, h.length),
                l = [];
            let o, r, n = wt(t, (e, t) => {
                const n = {};
                return tt(e, (e, s) => {
                    const a = g[s];
                    a && (c(a, _t) ? l.push({
                        rIndex: t,
                        checked: re(e)
                    }) : c(a, Bt) ? (!o && (o = a), re(e) && (r = s)) : a.property && gt(n, a.property, e))
                }), n
            });
            if (s && (p.insertRows = n, n = s(p)), n && n.length) return Promise.resolve(R).then(() => e.insertAt(n, -1).then(({
                rows: t
            }) => {
                const {
                    afterFullData: n
                } = e;
                return x = mt(n), p.insertRows = t, o && (t[r] ? e.setRadioRow(t[r]) : e.clearRadioRow()), tt(l, l => {
                    e.setCheckboxRow(t[l.rIndex], l.checked)
                }), e[Kt]([{
                    type: It,
                    startColumn: v,
                    endColumn: A,
                    startRow: C,
                    endRow: x
                }], {
                    column: v,
                    row: C
                }), p
            }))
        }
        return Promise.resolve(p)
    }

    function ue(e, t, l) {
        const {
            afterFullData: o,
            visibleColumn: r
        } = e, n = Ze(o, pt(t)), s = Ze(r, pt(l));
        for (let o = 0, r = t.length; o < r; o++) {
            const t = n + o;
            for (let o = 0, a = l.length; o < a; o++) {
                const l = s + o,
                    i = F(e, t, l);
                if (i) {
                    const {
                        row: e,
                        col: t,
                        rowspan: l,
                        colspan: o
                    } = i;
                    if (n > e || n + r < e + l || s > t || s + a < t + o) return !1
                }
            }
        }
        return !0
    }

    function he(e, t, l, o) {
        const {
            afterFullData: r,
            visibleColumn: n
        } = e, s = Ze(r, l), a = Ze(n, o);
        if (t.length) {
            if (1 === t.length) {
                const {
                    cols: l,
                    rows: o
                } = pt(t);
                if (1 === l.length && 1 === o.length) return !0;
                else {
                    const t = Ze(r, pt(o)),
                        i = Ze(n, pt(l)),
                        d = F(e, s, a);
                    if (d) {
                        const {
                            row: e,
                            col: r,
                            rowspan: n,
                            colspan: s
                        } = d;
                        if (t === e && o.length === n && i === r && l.length === s) return !0
                    }
                }
            }
            return !1
        }
        return !0
    }

    function ge(e, t, l, o) {
        const {
            afterFullData: r,
            visibleColumn: n
        } = e;
        let s = r[t];
        const a = n[l];
        if (s) {
            const t = Ze(r, s),
                l = Ze(n, a),
                o = F(e, t, l);
            if (o) {
                const {
                    row: e
                } = o;
                t !== e && (s = r[e])
            }
        } else if (o) return l--, 0 > l && (l = n.length - 1), t = r.length - 1, ge(e, t, l, o);
        return {
            offsetRow: s,
            offsetColumn: a
        }
    }

    function pe(e, t, l, o) {
        const {
            afterFullData: r,
            visibleColumn: n
        } = e;
        let s = r[t];
        const a = n[l];
        if (s) {
            const t = Ze(r, s),
                l = Ze(n, a),
                o = F(e, t, l);
            if (o) {
                const {
                    row: e,
                    rowspan: l
                } = o;
                t !== e && (s = r[e + l - 1 + 1])
            }
        } else if (o) return l++, l > n.length - 1 && (l = 0), t = 0, pe(e, t, l, o);
        return {
            offsetRow: s,
            offsetColumn: a
        }
    }

    function me(e, t, l, o) {
        const {
            afterFullData: r,
            visibleColumn: n
        } = e, s = r[t];
        let a = n[l];
        if (a) {
            const t = Ze(r, s),
                l = Ze(n, a),
                o = F(e, t, l);
            if (o) {
                const {
                    col: e
                } = o;
                l !== e && (a = n[e])
            }
        } else if (o) return t--, 0 > t && (t = r.length - 1), l = n.length - 1, me(e, t, l, o);
        return {
            offsetRow: s,
            offsetColumn: a
        }
    }

    function we(e, t, l, o) {
        const {
            afterFullData: r,
            visibleColumn: n
        } = e, s = r[t];
        let a = n[l];
        if (a) {
            const t = Ze(r, s),
                l = Ze(n, a),
                o = F(e, t, l);
            if (o) {
                const {
                    col: e,
                    colspan: t
                } = o;
                l !== e && (a = n[l + t - 1 + 1])
            }
        } else if (o) return t++, t > r.length - 1 && (t = 0), l = 0, we(e, t, l, o);
        return {
            offsetRow: s,
            offsetColumn: a
        }
    }

    function Ce(e, t, l, o, r) {
        const {
            afterFullData: n,
            visibleColumn: s
        } = e, a = t[l], {
            cols: i,
            rows: d
        } = a;
        let c = d[o];
        const f = i[r];
        if (c) {
            const u = Ze(n, c),
                h = Ze(s, f),
                g = F(e, u, h);
            if (g) {
                const {
                    row: s,
                    col: p
                } = g, m = Ze(d, n[s]);
                return u === s && h === p ? (o = m, c = d[r], {
                    offsetArea: a,
                    offsetRow: c,
                    offsetColumn: f
                }) : (h === p ? (o = m, c = d[o]) : (o = m - 1, 0 > o && (r--, 0 > r && (r = i.length - 1), o = d.length - 1)), Ce(e, t, l, o, r))
            }
            return {
                offsetArea: a,
                offsetRow: c,
                offsetColumn: f
            }
        }
        return r--, 0 > r ? (l--, 0 > l && (l = t.length - 1), o = t[l].rows.length - 1, r = t[l].cols.length - 1) : o = d.length - 1, Ce(e, t, l, o, r)
    }

    function xe(e, t, l, o, r) {
        const {
            afterFullData: n,
            visibleColumn: s
        } = e, a = t[l], {
            cols: i,
            rows: d
        } = a;
        let c = d[o];
        const f = i[r];
        if (c) {
            const u = Ze(n, c),
                h = Ze(s, f),
                g = F(e, u, h);
            if (g) {
                const {
                    row: s,
                    col: p,
                    rowspan: m
                } = g, w = Ze(d, n[s]);
                return u === s && h === p ? (o = w, c = d[o], {
                    offsetArea: a,
                    offsetRow: c,
                    offsetColumn: f
                }) : (h === p ? (o = w + m - 1 + 1, c = d[o]) : (o = w + m - 1 + 1, o > d.length + 1 && (r++, o > i.length - 1 && (r = 0), o = 0)), xe(e, t, l, o, r))
            }
            return {
                offsetArea: a,
                offsetRow: c,
                offsetColumn: f
            }
        }
        return o++, r++, o > d.length - 1 && (o = 0), r > i.length - 1 && (l++, l > t.length - 1 && (l = 0), r = 0), xe(e, t, l, o, r)
    }

    function ve(e, t, l, o, r, n, s) {
        p(e);
        const a = d(e, Mt.ENTER),
            {
                afterFullData: i,
                visibleColumn: c
            } = t,
            {
                row: f,
                column: u
            } = l,
            h = t[Gt](),
            g = !a || he(t, h, f, u);
        if (g) {
            let e = Ze(i, f),
                l = Ze(c, u),
                d = f,
                h = u;
            const g = F(t, e, l);
            if (r) {
                if (g) {
                    const {
                        row: t
                    } = g;
                    e = t
                }
                const {
                    offsetRow: o,
                    offsetColumn: r
                } = ge(t, e - 1, l, a);
                d = o, h = r
            } else if (s) {
                if (g) {
                    const {
                        row: t,
                        rowspan: l
                    } = g;
                    e = t + l - 1
                }
                const {
                    offsetRow: o,
                    offsetColumn: r
                } = pe(t, e + 1, l, a);
                d = o, h = r
            } else if (o) {
                if (g) {
                    const {
                        col: e
                    } = g;
                    l = e
                }
                const {
                    offsetRow: o,
                    offsetColumn: r
                } = me(t, e, l - 1);
                d = o, h = r
            } else if (n) {
                if (g) {
                    const {
                        col: e,
                        colspan: t
                    } = g;
                    l = e + t - 1
                }
                const {
                    offsetRow: o,
                    offsetColumn: r
                } = we(t, e, l + 1);
                d = o, h = r
            }
            d && h && (t[Jt](d, h), t[Kt]([{
                type: It,
                startColumn: h,
                endColumn: h,
                startRow: d,
                endRow: d
            }], {
                column: h,
                row: d
            }))
        } else {
            const e = t[qt]();
            if (e) {
                const {
                    area: l,
                    row: o,
                    column: n
                } = e, s = at(h, e => e === l);
                let a = h[s],
                    i = o,
                    d = n;
                if (a) {
                    const {
                        cols: e,
                        rows: l
                    } = a, c = Ze(l, o), f = Ze(e, n), {
                        offsetArea: u,
                        offsetRow: g,
                        offsetColumn: p
                    } = r ? Ce(t, h, s, c - 1, f) : xe(t, h, s, c + 1, f);
                    a = u, i = g, d = p
                }
                i && d && t[Jt](i, d).then(() => {
                    t[zt]({
                        area: a,
                        column: d,
                        row: i
                    })
                })
            }
        }
    }

    function Re(e, t, l, o, r) {
        const {
            $vxe: n,
            afterFullData: s,
            visibleColumn: a
        } = t, {
            modal: i
        } = n;
        if (p(e), 1 >= o.length) {
            const {
                row: e,
                column: o
            } = l, {
                row: n,
                column: i
            } = r, d = Ze(s, e), c = Ze(a, o), f = Ze(s, n), u = Ze(a, i), h = d > f ? n : e, g = d > f ? e : n, p = c > u ? i : o, m = c > u ? o : i;
            t[Kt]([{
                type: It,
                startRow: h,
                endRow: g,
                startColumn: p,
                endColumn: m
            }], {
                column: o,
                row: e
            })
        } else i && i[Yt]({
            message: u(t, "vxe.pro.area.multiErr"),
            status: Wt,
            id: Ot
        })
    }

    function Ae(e, t, r, n, s, a, i) {
        p(e);
        const {
            afterFullData: d,
            visibleColumn: c
        } = t, {
            area: f,
            row: u,
            column: h
        } = r, {
            rows: g,
            cols: m
        } = f;
        let w = pt(g),
            C = mt(g),
            x = pt(m),
            v = mt(m);
        const R = Ze(d, u),
            A = Ze(c, h);
        let b = Ze(d, w),
            S = Ze(c, x),
            E = Ze(d, C),
            y = Ze(c, v),
            I = g,
            T = m;
        const $ = F(t, R, A);
        if (s || i) {
            if (s) {
                if (tt(m, e => {
                        const l = Ze(c, e),
                            r = F(t, E, l);
                        if (r) {
                            const {
                                row: e
                            } = r;
                            E = o(E, e)
                        }
                    }), E > ($ ? R + $.rowspan - 1 : R)) E -= 1, C = d[E];
                else {
                    if (0 >= b) return;
                    b -= 1, w = d[b]
                }
            } else if (tt(m, e => {
                    const o = Ze(c, e),
                        r = F(t, b, o);
                    if (r) {
                        const {
                            row: e,
                            rowspan: t
                        } = r;
                        b = l(b, e + t - 1)
                    }
                }), b < ($ ? R + $.rowspan - 1 : R)) b += 1, w = d[b];
            else {
                if (E >= d.length - 1) return;
                E += 1, C = d[E]
            }
            const {
                rows: e,
                cols: r
            } = O(t, Ge(d, b, E + 1), T);
            I = e, T = r
        } else {
            if (n) {
                if (tt(g, e => {
                        const l = Ze(d, e),
                            r = F(t, l, y);
                        if (r) {
                            const {
                                col: e
                            } = r;
                            y = o(y, e)
                        }
                    }), y > ($ ? A + $.colspan - 1 : A)) y -= 1, v = c[y];
                else {
                    if (0 >= S) return;
                    S -= 1, x = c[S]
                }
            } else if (tt(g, e => {
                    const o = Ze(d, e),
                        r = F(t, o, S);
                    if (r) {
                        const {
                            col: e,
                            colspan: t
                        } = r;
                        S = l(S, e + t - 1)
                    }
                }), S < ($ ? A + $.colspan - 1 : A)) S += 1, x = c[S];
            else {
                if (y >= c.length - 1) return;
                y += 1, v = c[y]
            }
            const {
                rows: e,
                cols: r
            } = O(t, I, Ge(c, S, y + 1));
            I = e, T = r
        }
        w = pt(I), C = mt(I), x = pt(T), v = mt(T), t[Xt]("cell-area-arrows-start", {
            rows: g,
            cols: m,
            isLeft: n,
            isUp: s,
            isRight: a,
            isDown: i
        }, e), s || i ? t[Jt](pt(g) === w ? C : w) : t[Zt](pt(m) === x ? v : x), t[Kt]([{
            type: It,
            startRow: w,
            endRow: C,
            startColumn: x,
            endColumn: v
        }], {
            column: h,
            row: u
        }), t[Xt]("cell-area-arrows-end", {
            rows: g,
            cols: m,
            isLeft: n,
            isUp: s,
            isRight: a,
            isDown: i,
            targetRows: I,
            targetCols: T
        }, e)
    }

    function be(e, t, l, o, r) {
        const {
            afterFullData: n,
            visibleColumn: s
        } = e, a = t[l], {
            cols: i,
            rows: d
        } = a, c = d[o];
        let f = i[r];
        if (f) {
            const u = Ze(n, c),
                h = Ze(s, f),
                g = F(e, u, h);
            if (g) {
                const {
                    row: n,
                    col: p
                } = g, m = Ze(i, s[p]);
                return u === n && h === p ? (r = m, f = i[r], {
                    offsetArea: a,
                    offsetRow: c,
                    offsetColumn: f
                }) : (u === n ? (r = m, f = i[r]) : (r = m - 1, 0 > r && (o--, 0 > o && (o = d.length - 1), r = i.length - 1)), be(e, t, l, o, r))
            }
            return {
                offsetArea: a,
                offsetRow: c,
                offsetColumn: f
            }
        }
        return o--, 0 > o ? (l--, 0 > l && (l = t.length - 1), o = t[l].rows.length - 1, r = t[l].cols.length - 1) : r = i.length - 1, be(e, t, l, o, r)
    }

    function Se(e, t, l, o, r) {
        const {
            afterFullData: n,
            visibleColumn: s
        } = e, a = t[l], {
            cols: i,
            rows: d
        } = a, c = d[o];
        let f = i[r];
        if (f) {
            const u = Ze(n, c),
                h = Ze(s, f),
                g = F(e, u, h);
            if (g) {
                const {
                    row: n,
                    col: p,
                    colspan: m
                } = g, w = Ze(i, s[p]);
                return u === n && h === p ? (r = w, f = i[r], {
                    offsetArea: a,
                    offsetRow: c,
                    offsetColumn: f
                }) : (u === n ? (r = w + m - 1 + 1, f = i[r]) : (r = w + m - 1 + 1, r > i.length - 1 && (o++, o > d.length - 1 && (l++, l > t.length - 1 && (l = 0), o = 0), r = 0)), Se(e, t, l, o, r))
            }
            return {
                offsetArea: a,
                offsetRow: c,
                offsetColumn: f
            }
        }
        return o++, o > d.length - 1 ? (l++, l > t.length - 1 && (l = 0), o = 0, r = 0) : r = 0, Se(e, t, l, o, r)
    }

    function Ee(e, t, l, o) {
        const {
            afterFullData: r,
            visibleColumn: n
        } = t, {
            column: s,
            row: a
        } = l, i = t[Gt](), d = he(t, i, a, s);
        if (d) {
            const e = Ze(r, a);
            let l = Ze(n, s),
                i = a,
                d = s;
            const c = F(t, e, l);
            if (c) {
                const {
                    col: e,
                    colspan: t
                } = c;
                l = o ? e : l + t - 1
            }
            const {
                offsetRow: f,
                offsetColumn: u
            } = o ? me(t, e, l - 1, !0) : we(t, e, l + 1, !0);
            i = f, d = u, i && d && (t[Jt](i, d), t[Kt]([{
                type: It,
                startColumn: d,
                endColumn: d,
                startRow: i,
                endRow: i
            }], {
                column: d,
                row: i
            }))
        } else {
            const e = t[qt]();
            if (e) {
                const {
                    area: l,
                    row: r,
                    column: n
                } = e, s = at(i, e => e === l);
                let a = i[s],
                    d = r,
                    c = n;
                if (a) {
                    const {
                        cols: e,
                        rows: l
                    } = a, f = Ze(l, r), u = Ze(e, n), {
                        offsetArea: h,
                        offsetRow: g,
                        offsetColumn: p
                    } = o ? be(t, i, s, f, u - 1) : Se(t, i, s, f, u + 1);
                    a = h, d = g, c = p
                }
                d && c && t[Jt](d, c).then(() => {
                    t[zt]({
                        area: a,
                        column: c,
                        row: d
                    })
                })
            }
        }
    }

    function ye(e, t, l, o, r, n, s, a, i) {
        const {
            clientX: d,
            clientY: c
        } = e, {
            $refs: f,
            scrollbarWidth: u
        } = t, h = f.leftContainer, g = f.rightContainer, p = d - o, m = c - r, w = a.scrollLeft, x = i.scrollTop;
        let v = p + (w - n);
        let R, A, b = 0;
        h && (b = h.offsetWidth, R = C(h)), g && (A = C(g));
        const {
            scrollWidth: S,
            offsetWidth: E
        } = a, y = S - E - w;
        return R && A ? "left" === l ? d > A.left ? v = p + w + u + y : d < R.left + b && (v = p) : "right" === l ? d < R.left + b ? v = p - u - y - w : d < A.left && (v = p - u - y) : d < R.left + b ? v = p - u - (n - w) - w : d > A.left && (v = p + (w - n) + u + y) : R ? "left" === l ? d < R.left + b && (v = p) : d < R.left + b && (v = p - u - (n - w) - w) : A && ("right" === l ? d < A.left && (v = p - u - y) : d > A.left && (v = p + (w - n) + u + y)), {
            moveX: p,
            moveY: m,
            offsetLeft: v,
            offsetTop: m + (x - s)
        }
    }

    function Ie(t, l) {
        const {
            $vxe: o,
            fnrStore: r
        } = t, {
            modal: n
        } = o;
        if (r.showREErr = !1, r.findCellRE = null, r.isRE) try {
            r.findCellRE = new RegExp(l, r.isSensitive ? "" : "i")
        } catch (l) {
            return r.showREErr = !0, n && n[Yt]({
                message: u(t, "vxe.pro.fnr.reError"),
                status: Wt,
                id: Ot
            }), !1
        }
        return !0
    }

    function Te(e, t, l, o) {
        if (l.property) {
            const {
                fnrStore: r,
                fnrOpts: n
            } = e, {
                isWhole: s,
                isRE: a,
                isSensitive: i,
                findCellRE: d
            } = r, {
                findMethod: c
            } = n;
            let f = dt(ht(t, l.property));
            return c ? c({
                cellValue: f,
                isWhole: s,
                isRE: a,
                isSensitive: i,
                findValue: o,
                findRE: d
            }) : o ? a ? d && d.test(f) : (i || (f = f.toLowerCase(), o = o.toLowerCase()), s ? f === o : -1 < Ze(f, o)) : !f
        }
        return !1
    }

    function $e(e, t, l, o, r, n, s, a, i, d) {
        const {
            afterFullData: c,
            visibleColumn: f
        } = e, u = [];
        for (let h = l, g = t.length; h < g; h++) {
            const g = t[h],
                {
                    rows: p,
                    cols: m
                } = g,
                w = Ze(c, pt(p)),
                C = Ze(f, pt(m));
            for (let t = h === l ? r : 0, x = p.length; t < x; t++) {
                const p = w + t;
                for (let w = h === l && t === r ? s : 0, x = m.length; w < x; w++) {
                    const l = C + w,
                        r = F(e, p, l);
                    if (r) {
                        const {
                            row: e,
                            col: t
                        } = r;
                        if (p !== e || l !== t) continue
                    }
                    const s = c[p],
                        m = f[l];
                    if (Te(e, s, m, i) && (u.push({
                            _rowIndex: p,
                            _columnIndex: l,
                            offsetArea: g,
                            offsetRow: s,
                            offsetColumn: m
                        }), !d)) return u;
                    if (h >= o && t >= n && w >= a) return u
                }
            }
        }
        return u
    }

    function Fe(e, t, l, o, r, n, s) {
        const {
            afterFullData: a,
            visibleColumn: i
        } = e, d = Ze(a, t), c = Ze(i, l) + 1, f = Ze(a, o), u = Ze(i, r) + 1, h = [];
        for (let g = 0, p = a.length; g < p; g++) {
            const t = d + g;
            for (let l = 0 == g ? c : 0, o = i.length; l < o; l++) {
                const o = F(e, t, l);
                if (o) {
                    const {
                        row: e,
                        col: r
                    } = o;
                    if (t !== e || l !== r) continue
                }
                const r = a[t],
                    d = i[l];
                if (Te(e, r, d, n) && (h.push({
                        _rowIndex: t,
                        _columnIndex: l,
                        offsetRow: r,
                        offsetColumn: d
                    }), !s)) return h;
                if (g >= f && l >= u) return h
            }
        }
        return h
    }

    function De(e) {
        const {
            fnrActiveModal: t
        } = e;
        e[Ht](() => {
            if (t) {
                const l = w(t.$el, ".vxe-table--fnr-form-input .vxe-input--inner");
                l && (e.blur(), l.focus())
            }
        })
    }

    function Me(e, t) {
        const {
            afterFullData: l,
            visibleColumn: o,
            fnrStore: r
        } = e, n = e[qt](), s = e[Gt]();
        let a = pt(l),
            i = pt(o),
            d = mt(l),
            c = mt(o);
        const f = dt(r.findValue);
        let u = [],
            h = !0;
        if (r.showREErr = !1, !Ie(e, f)) return u;
        if (n) {
            const {
                row: l,
                column: o
            } = n;
            h = he(e, s, l, o), !t && h && (a = l, i = o)
        }
        if (h) {
            if (u = Fe(e, a, i, d, c, f, t), !t && (u.length || (d = a, c = i, a = pt(l), i = pt(o), u = Fe(e, a, i, d, c, f, t)), u.length)) {
                const {
                    offsetRow: t,
                    offsetColumn: l
                } = u[0];
                e[Jt](t, l), e[Kt]([{
                    type: It,
                    startRow: t,
                    endRow: t,
                    startColumn: l,
                    endColumn: l
                }])
            }
        } else if (n) {
            const {
                area: l,
                row: o,
                column: r
            } = n;
            let a = t ? 0 : at(s, e => e === l);
            const i = s[a];
            if (i) {
                const {
                    cols: l,
                    rows: n
                } = i;
                let d = t ? 0 : Ze(n, o),
                    c = t ? 0 : Ze(l, r) + 1,
                    h = s.length - 1;
                const g = s[h];
                let p = g.rows.length - 1,
                    m = g.cols.length - 1;
                if (u = $e(e, s, a, h, d, p, c, m, f, t), !t && (u.length || (h = a, p = d, m = c, a = 0, d = 0, c = 0, u = $e(e, s, a, h, d, p, c, m, f, t)), u.length)) {
                    const {
                        offsetArea: t,
                        offsetRow: l,
                        offsetColumn: o
                    } = u[0];
                    e[Jt](l, o).then(() => {
                        e[zt]({
                            area: t,
                            column: o,
                            row: l
                        })
                    })
                }
            }
        }
        return u
    }

    function ke(e) {
        tt(e.fnrSearchList, e => {
            e.isActived = !1
        })
    }

    function Ve(e, t) {
        const {
            $vxe: l,
            fnrOpts: o,
            fnrStore: r,
            fnrTabs: n
        } = e, {
            modal: s
        } = l, a = e[qt](), i = ft(n, e => "find" === e.value && !!o.isFind || "replace" === e.value && !!o.isReplace), d = -1 < Ze(i, t) ? t : i[0];
        St && d && (r.visible = !0, r.activeTab = d.value, r.findValue = a ? ht(a.row, a.column.property) : "", s.open({
            title: u(e, "vxe.pro.fnr.title"),
            className: "vxe-table--ignore-areas-clear vxe-table--fnr",
            size: e.vSize,
            width: 540,
            minWidth: 540,
            height: 370,
            minHeight: 370,
            resize: !0,
            showZoom: !0,
            lockView: !1,
            mask: !1,
            escClosable: !0,
            events: {
                hide() {
                    const {
                        fnrStore: t
                    } = e;
                    t.visible = !1, t.showCount = !1, e.fnrSearchList = [], e.fnrActiveModal = !1, e.focus()
                },
                show(t) {
                    e.fnrActiveModal = t.$modal, De(e)
                }
            },
            slots: {
                default (t, l) {
                    const {
                        fnrStore: o,
                        fnrSearchList: r
                    } = e, {
                        $modal: n
                    } = t, {
                        activeTab: s,
                        isRE: a,
                        showREErr: d
                    } = o, c = [], f = "vxe-table--fnr-";
                    return "replace" === s && c.push(l("vxe-button", {
                        on: {
                            click: e.triggerFNRReplaceAllEvent
                        }
                    }, u(e, "vxe.pro.fnr.btns.replaceAll")), l("vxe-button", {
                        on: {
                            click: e.triggerFNRReplaceEvent
                        }
                    }, u(e, "vxe.pro.fnr.btns.replace"))), c.push(l("vxe-button", {
                        on: {
                            click: e.triggerFNRFindAllEvent
                        }
                    }, u(e, "vxe.pro.fnr.btns.findAll")), l("vxe-button", {
                        key: "findNext",
                        props: {
                            status: "primary"
                        },
                        on: {
                            click: e.triggerFNRFindEvent
                        }
                    }, u(e, "vxe.pro.fnr.btns.findNext")), l("vxe-button", {
                        on: {
                            click() {
                                n.close()
                            }
                        }
                    }, u(e, "vxe.pro.fnr.btns.cancel"))), [l("div", {
                        class: f + "tabs"
                    }, wt(i, (t, o) => l("span", {
                        key: o,
                        class: {
                            "is--active": s === t.value
                        },
                        on: {
                            click(l) {
                                e.triggerFNRTabChangeEvent(l, t)
                            }
                        }
                    }, u(e, t.label)))), l("div", {
                        class: f + "body"
                    }, [l("table", {
                        class: f + "form",
                        attrs: {
                            cellspacing: 0,
                            cellpadding: 0,
                            border: 0
                        }
                    }, [l("tbody", [l("tr", {
                        class: "is--visible"
                    }, [l("td", {
                        class: f + "form-title"
                    }, u(e, "vxe.pro.fnr.findTitle")), l("td", {
                        class: f + "form-content"
                    }, [l("vxe-input", {
                        class: f + "form-input",
                        props: {
                            value: o.findValue,
                            clearable: !0
                        },
                        on: {
                            input(e) {
                                o.findValue = ze(e) ? e.value : e
                            },
                            keydown: e.triggerFNRFindKeydownEvent
                        }
                    })]), l("td", {
                        class: f + "form-filter",
                        attrs: {
                            rowspan: 2
                        }
                    }, [l("vxe-checkbox", {
                        props: {
                            value: a,
                            content: u(e, "vxe.pro.fnr.filter.re")
                        },
                        on: {
                            input(e) {
                                o.isRE = e
                            }
                        }
                    }), l("vxe-checkbox", {
                        props: {
                            value: !a && o.isWhole,
                            disabled: a,
                            content: u(e, "vxe.pro.fnr.filter.whole")
                        },
                        on: {
                            input(e) {
                                o.isRE || (o.isWhole = e)
                            }
                        }
                    }), l("vxe-checkbox", {
                        props: {
                            value: o.isSensitive,
                            content: u(e, "vxe.pro.fnr.filter.sensitive")
                        },
                        on: {
                            input(e) {
                                o.isSensitive = e
                            }
                        }
                    })])]), l("tr", {
                        class: {
                            "is--visible": "replace" === o.activeTab
                        }
                    }, [l("td", {
                        class: f + "form-title"
                    }, u(e, "vxe.pro.fnr.replaceTitle")), l("td", {
                        class: f + "form-content"
                    }, [l("vxe-input", {
                        class: f + "form-input",
                        props: {
                            value: o.replaceValue,
                            clearable: !0
                        },
                        on: {
                            input(e) {
                                o.replaceValue = ze(e) ? e.value : e
                            },
                            keydown: e.triggerFNRReplaceKeydownEvent
                        }
                    })])])])])]), l("div", {
                        class: f + "footer"
                    }, c), l("div", {
                        class: f + "search"
                    }, [l("div", {
                        class: f + "search-header"
                    }, [l("div", u(e, "vxe.pro.fnr.header.seq")), l("div", u(e, "vxe.pro.fnr.header.cell")), l("div", u(e, "vxe.pro.fnr.header.value"))]), l("div", {
                        class: f + "search-body"
                    }, [l("vxe-list", {
                        class: f + "search-list",
                        props: {
                            data: r,
                            autoResize: !0,
                            scrollY: {
                                gt: 10,
                                sItem: f + "find-item"
                            }
                        },
                        scopedSlots: {
                            default (t, l) {
                                const {
                                    items: o
                                } = t;
                                return wt(o, t => l("div", {
                                    key: t.seq,
                                    class: [f + "find-item", {
                                        "is--active": t.isActived
                                    }],
                                    on: {
                                        click(l) {
                                            e.triggerFNRItemEvent(l, t)
                                        }
                                    }
                                }, [l("div", t.seq), l("div", "Row:" + (t.row + 1) + ", Col:" + (t.col + 1)), l("div", t.value)]))
                            }
                        }
                    })]), l("div", {
                        class: [f + "search-footer", {
                            "is--error": d,
                            "is--visible": d || o.showCount
                        }]
                    }, d ? u(e, "vxe.pro.fnr.reError") : u(e, "vxe.pro.fnr.recordCount", [o.findCount]))])]
                }
            }
        }))
    }

    function Oe(e, t) {
        const {
            mouseConfig: l,
            mouseOpts: o,
            fnrStore: r
        } = e;
        return l && o.area && (r.visible ? t.value !== r.activeTab && (r.activeTab = t.value, De(e)) : Ve(e, t)), e[Ht]()
    }

    function We(e, t) {
        const {
            afterFullData: l,
            visibleColumn: o
        } = t;
        l.length && o.length && (p(e), t[Kt]([{
            type: It,
            startRow: pt(l),
            endRow: mt(l),
            startColumn: pt(o),
            endColumn: mt(o)
        }]))
    }

    function Ne(e, t, l) {
        e.recalculate().then(() => {
            const {
                copyAreaMpas: o,
                afterFullData: r,
                visibleColumn: n
            } = e, s = [];
            if (tt(t, e => {
                    const {
                        type: t,
                        cols: l,
                        rows: o
                    } = e, a = rt(l, e => Qe(n, e)), i = rt(o, e => Qe(r, e));
                    if (i && a) {
                        const e = nt(l, e => Qe(n, e)),
                            d = nt(o, e => Qe(r, e));
                        s.push({
                            type: t,
                            startColumn: a,
                            endColumn: e,
                            startRow: i,
                            endRow: d
                        })
                    }
                }), s.length) {
                let o;
                l && (o = {
                    area: s[Ze(t, l.area)],
                    row: l.row,
                    column: l.column
                }), e[Kt](s, o)
            } else e[jt]();
            if (o) {
                const {
                    cols: t,
                    rows: l
                } = o, s = at(t, e => Qe(n, e)), a = at(l, e => Qe(r, e));
                if (-1 < s && -1 < a) {
                    const i = st(t, e => Qe(n, e)),
                        d = st(l, e => Qe(r, e));
                    o.cols = Ge(t, s, i + 1), o.rows = Ge(l, a, d + 1), e.copyAreaMpas = X(e, o)
                }
            }
        })
    }

    function Le(e, t) {
        const {
            $xegrid: l,
            $vxe: o,
            editStore: r,
            keyboardConfig: n,
            keyboardOpts: s,
            editConfig: a,
            editOpts: f,
            highlightCurrentRow: h,
            bodyCtxMenu: m,
            clipOpts: w,
            fnrOpts: C,
            ctxMenuStore: x,
            filterStore: v,
            copyAreaMpas: R,
            rowOpts: A
        } = t, {
            modal: b
        } = o, {
            actived: S
        } = r, {
            activeMethod: E
        } = f, {
            keyCode: y
        } = e, I = d(e, Mt.SPACEBAR), T = d(e, Mt.ESCAPE), F = d(e, Mt.ENTER), D = d(e, Mt.ARROW_LEFT), M = d(e, Mt.ARROW_UP), O = d(e, Mt.ARROW_RIGHT), W = d(e, Mt.ARROW_DOWN), N = d(e, Mt.TAB), L = d(e, Mt.BACKSPACE), _ = d(e, Mt.DELETE), B = d(e, Mt.A), H = d(e, Mt.X), P = d(e, Mt.C), Y = d(e, Mt.V), U = d(e, Mt.F), X = d(e, Mt.H), K = d(e, Mt.M), j = d(e, Mt.F2), q = d(e, Mt.CONTEXT_MENU), G = e.metaKey, z = e.ctrlKey, J = e.shiftKey, te = t[qt](), le = i(a) && S.column && S.row;
        if (I && te && n && s.isChecked) {
            const l = te.column,
                o = {
                    row: te.row,
                    column: l
                };
            c(l, _t) ? (p(e), t.handleToggleCheckRowEvent(e, o)) : c(l, Bt) && (p(e), t.triggerRadioRowEvent(e, o))
        }
        if (T) v.visible && (g(e), t.closeFilter()), x.visible && (g(e), t.closeMenu()), R ? (g(e), t[Qt]()) : $(e, t);
        else if (j && i(a) && te) {
            if (!le) {
                const {
                    offsetRow: l,
                    offsetColumn: o
                } = V(t, te.row, te.column);
                if (i(o.editRender)) {
                    const r = {
                        row: l,
                        column: o,
                        cell: t.getCell(l, o)
                    };
                    p(e), t.handleActived(r, e)
                }
            }
        } else if (q) t._keyCtx = te && te.row && te.column && m.length, clearTimeout(t.keyCtxTimeout), t.keyCtxTimeout = setTimeout(() => {
            t._keyCtx = !1
        }, 1e3);
        else if (z && K && n && s.isMerge && te) le || (p(e), k(t, e), t[Qt]());
        else if (z && n && s.isFNR && (U && C.isFind || X && C.isReplace)) {
            p(e);
            const l = t.fnrTabs[U ? 0 : 1];
            t.fnrStore.visible ? t.triggerFNRTabChangeEvent(e, l) : t.triggerFNROpenEvent(e, l.value), $(e, t)
        } else if (F && n && s.isEnter) {
            const {
                column: l,
                row: o
            } = S;
            if (l && o) {
                const {
                    offsetRow: r,
                    offsetColumn: n
                } = V(t, o, l);
                p(e), t.clearActived(), s.enterToTab ? Ee(e, t, {
                    row: r,
                    column: n
                }, J) : ve(e, t, {
                    row: r,
                    column: n
                }, !1, J, !1, !J)
            } else te && (p(e), s.enterToTab ? Ee(e, t, te, J) : ve(e, t, te, !1, J, !1, !J))
        } else if ((D || M || O || W) && n && s.isArrow) {
            if (!le)
                if (!te)(M || W) && (A.isCurrent || h) && t.moveCurrentRow(M, W, e);
                else if (J) {
                const l = t[Gt]();
                1 >= l.length ? Ae(e, t, te, D, M, O, W) : b && b[Yt]({
                    message: u(t, "vxe.pro.area.multiErr"),
                    status: Wt,
                    id: Ot
                })
            } else ve(e, t, te, D, M, O, W);
        } else if (N && n && s.isTab) {
            const {
                column: l,
                row: o
            } = S;
            if (o && l) {
                const {
                    offsetRow: r,
                    offsetColumn: n
                } = V(t, o, l);
                p(e), t.clearActived(), Ee(e, t, {
                    row: r,
                    column: n
                }, J)
            } else te && (p(e), Ee(e, t, te, J))
        } else if ((_ || L) && i(a) && n && s.isDel) {
            const {
                delMethod: o,
                backMethod: r
            } = s;
            if (!le)
                if (L && te) {
                    const {
                        column: o,
                        row: n
                    } = te;
                    if (n && o) {
                        const {
                            offsetRow: s,
                            offsetColumn: a
                        } = V(t, n, o);
                        if (i(a.editRender)) {
                            const o = {
                                row: s,
                                rowIndex: t.getRowIndex(s),
                                column: a,
                                columnIndex: t.getColumnIndex(a),
                                cell: t.getCell(s, a),
                                $table: t,
                                $grid: l
                            };
                            (!E || E(o)) && (r ? r(o) : (o.cell = t.getCell(s, a), gt(s, a.property, null), t.handleActived(o, e)))
                        }
                    }
                } else if (_) {
                const e = t[Gt]();
                tt(e, e => {
                    const {
                        rows: r,
                        cols: n
                    } = e;
                    tt(r, e => {
                        tt(n, r => {
                            if (i(r.editRender)) {
                                const n = t.getRowIndex(e),
                                    s = t.getColumnIndex(r),
                                    a = {
                                        row: e,
                                        rowIndex: n,
                                        column: r,
                                        columnIndex: s,
                                        cell: t.getCell(e, r),
                                        $table: t,
                                        $grid: l
                                    };
                                (!E || E({
                                    row: e,
                                    column: r
                                })) && (o ? o(a) : gt(e, r.property, null))
                            }
                        })
                    })
                })
            }
        } else if (n && z && B) le || (console.log(111), We(e, t));
        else if (n && s.isClip && z && Rt.msie && (H || P || Y)) {
            if (!le) {
                const l = vt.clipboardData;
                if (l && Z(t))
                    if (H && !1 !== w.isCut || P && !1 !== w.isCopy) {
                        const o = ee(t, e, H),
                            {
                                text: r,
                                status: n
                            } = o;
                        l[Ut]("text", r), n && Q(t, o, H)
                    } else if (Y && !1 !== w.isPaste) {
                    const o = l.getData("text");
                    se(t, e, {
                        text: o
                    })
                }
            }
        } else if (n && i(a) && s.isEdit && !z && !G && (I || 48 <= y && 57 >= y || 65 <= y && 90 >= y || 96 <= y && 111 >= y || 186 <= y && 192 >= y || 219 <= y && 222 >= y) && !le && te) {
            const {
                column: o,
                row: r
            } = te;
            if (r && o) {
                const {
                    offsetRow: n,
                    offsetColumn: a
                } = V(t, r, o), {
                    editMethod: d
                } = s;
                if (i(a.editRender)) {
                    const o = {
                        row: n,
                        rowIndex: t.getRowIndex(n),
                        column: a,
                        columnIndex: t.getColumnIndex(a),
                        cell: t.getCell(n, a),
                        $table: t,
                        $grid: l
                    };
                    (!E || E(o)) && (d ? d(o) : (gt(n, a.property, null), t.handleActived(o, e)))
                }
            }
        }
    }

    function _e(e, t) {
        return wt(t, e => wt(e, e => {
            let t = 0;
            const l = !isNaN(e);
            let o = "{0}";
            return l ? t = e : o = dt(e).replace(/\d+(?!.*\d)/, e => (t = e, "{0}")), {
                v: o,
                n: it(t),
                t: l
            }
        }))
    }

    function Be(t, l, o) {
        const {
            targetValues: r,
            targetRows: n,
            extendRows: s,
            extendCols: a
        } = l, i = _e(t, r), d = i[o ? 0 : i.length - 2], c = i[o ? 1 : i.length - 1], f = wt(a, (e, t) => {
            const l = d[t],
                r = c[t];
            return {
                offset: o ? l.n - r.n : r.n - l.n,
                num: o ? l.n : r.n
            }
        }), u = wt(s, (t, l) => {
            const r = l % n.length,
                s = i[o ? i.length - r - 1 : r];
            return wt(a, (t, l) => {
                const o = s[l],
                    r = f[l],
                    {
                        num: n,
                        offset: a
                    } = r,
                    i = n + a;
                return !o.t && 0 >= i && (r.offset = e(a)), r.num = i, ct(o.v, [i])
            })
        });
        return o && u.reverse(), u
    }

    function He(t, l, o) {
        const {
            targetValues: r,
            targetCols: n,
            extendRows: s,
            extendCols: a
        } = l, i = _e(t, r), d = wt(i, e => {
            const t = e[o ? 0 : e.length - 2],
                l = e[o ? 1 : e.length - 1];
            return {
                offset: o ? t.n - l.n : l.n - t.n,
                num: o ? t.n : l.n
            }
        });
        return wt(s, (t, l) => {
            const r = d[l],
                s = i[l],
                c = wt(a, (t, l) => {
                    const a = l % n.length,
                        i = s[o ? s.length - a - 1 : a],
                        {
                            num: d,
                            offset: c
                        } = r,
                        f = d + c;
                    return !i.t && 0 >= f && (r.offset = e(c)), r.num = f, ct(i.v, [f])
                });
            return o && c.reverse(), c
        })
    }

    function Pe(e, t, l, o, r) {
        const {
            $xegrid: n,
            afterFullData: s,
            visibleColumn: a,
            areaOpts: i = {}
        } = e, {
            rows: d,
            cols: c
        } = r, f = d.length > l.length, u = c.length > o.length, h = t.shiftKey, g = t.ctrlKey;
        let p;
        if (!h && (f || u)) {
            const {
                extendByCopy: t,
                extendByCalc: r,
                extendCalcMethod: h,
                extendSetMethod: m,
                beforeExtendSetMethod: w,
                afterExtendSetMethod: C
            } = i, x = Ze(s, l[0]), v = Ze(s, d[0]), R = Ze(a, o[0]), A = Ze(a, c[0]);
            let b = !1,
                S = !1,
                E = [];
            if (f) {
                const s = !g && r && 2 <= l.length;
                if (t || s) {
                    let t = [];
                    E = wt(l, t => wt(o, l => z(e, t, l, 0))), v < x ? (b = !0, t = Ge(d, 0, d.length - l.length)) : t = Ge(d, l.length);
                    const r = {
                        rows: d,
                        cols: c,
                        targetValues: E,
                        targetRows: l,
                        targetCols: o,
                        extendRows: Ge(t, 0),
                        extendCols: o,
                        direction: b ? "up" : "down",
                        $table: e,
                        $grid: n
                    };
                    w && !1 === w(r) || (p = E, s && (h ? p = h(r) : p = Be(e, r, b)), tt(t, (e, l) => {
                        const n = b ? t.length % p.length : 0,
                            s = (n + l) % p.length,
                            a = p[s];
                        tt(o, (t, l) => {
                            const o = a[l % a.length];
                            if (m) m(qe({
                                cellValue: o,
                                row: e,
                                column: t
                            }, r));
                            else {
                                const {
                                    property: l
                                } = t;
                                l && gt(e, l, o)
                            }
                        })
                    }), C && C(qe({
                        extendValues: p
                    }, r)))
                }
            } else if (u) {
                const s = !g && r && 2 <= o.length;
                if (t || s) {
                    let t = [];
                    A < R ? (S = !0, t = Ge(c, 0, c.length - o.length)) : t = Ge(c, o.length), E = wt(l, t => wt(o, l => z(e, t, l, 0)));
                    const r = {
                        rows: d,
                        cols: c,
                        targetValues: E,
                        targetRows: l,
                        targetCols: o,
                        extendRows: l,
                        extendCols: Ge(t, 0),
                        direction: S ? "left" : "right",
                        $table: e,
                        $grid: n
                    };
                    w && !1 === w(r) || (p = E, s && (h ? p = h(r) : p = He(e, r, S)), tt(l, (e, l) => {
                        const o = l % p.length,
                            n = p[o],
                            s = S ? t.length % n.length : 0;
                        tt(t, (t, l) => {
                            const o = (s + l) % n.length,
                                a = n[o];
                            if (m) m(qe({
                                cellValue: a,
                                row: e,
                                column: t
                            }, r));
                            else {
                                const {
                                    property: l
                                } = t;
                                l && gt(e, l, a)
                            }
                        })
                    }), C && C(qe({
                        extendValues: p
                    }, r)))
                }
            }
        }
    }

    function Ye(t, l, r) {
        const {
            button: n
        } = t;
        if (!(0 === n)) return;
        const {
            fixed: s
        } = r, a = l[Gt](), i = rt(a, e => e.type === It);
        if (h(l), i) {
            const n = document.onmousemove,
                a = document.onmouseup,
                {
                    $el: d,
                    $refs: c,
                    $vxe: f,
                    afterFullData: g,
                    visibleColumn: p
                } = l,
                {
                    modal: x
                } = f,
                S = t.clientX,
                E = t.clientY,
                {
                    tableBody: y,
                    rightBody: I,
                    tableFooter: T
                } = c,
                $ = y.$el,
                D = I ? I.$el : null,
                M = T ? T.$el : null,
                k = D || $,
                V = M || $,
                {
                    rows: O,
                    cols: L
                } = i,
                _ = pt(L),
                P = pt(O),
                Y = mt(L),
                U = mt(O),
                K = i.top,
                j = i.left,
                q = i.width,
                G = i.height,
                z = b(l, _.fixed),
                J = w(z, ".vxe-table--cell-area"),
                Z = J.children[2],
                Q = k.scrollTop,
                ee = "left" === s ? 0 : V.scrollLeft,
                te = Ze(g, U),
                le = Ze(p, Y),
                oe = F(l, te, le);
            let re, ne = 1,
                se = 1,
                ae = 0,
                ie = 0,
                de = null,
                ce = null;
            const fe = w(z, ".vxe-body--row"),
                he = fe.firstChild,
                ge = {
                    el: null,
                    type: $t,
                    cols: [],
                    rows: [],
                    top: 0,
                    left: 0,
                    width: 0,
                    height: 0
                },
                pe = t => {
                    const {
                        offsetTop: r,
                        offsetLeft: n
                    } = ye(t, l, s, S, E, ee, Q, V, k), a = e(r), i = e(n), d = V.scrollWidth, c = k.scrollHeight;
                    let f = G,
                        u = q,
                        h = K,
                        g = j;
                    switch (re) {
                        case "top":
                            if (r < -G) {
                                const e = o(K, W(l, P, _, oe, !1, a - G));
                                h -= e, f += e
                            }
                            break;
                        case "bottom":
                            0 < r && (f += o(c - K - G, W(l, U, Y, oe, !0, a)));
                            break;
                        case "left":
                            if (n < -q) {
                                const e = o(j, N(l, P, _, oe, !1, i - q));
                                g -= e, u += e
                            }
                            break;
                        case "right":
                            0 < n && (u += o(d - j - q, N(l, U, Y, oe, !0, i)));
                    }
                    ge.height = f, ge.width = u, ge.left = g, ge.top = h, ge.cols = B(l, he, ge), ge.rows = H(l, fe, ge), qe(ge, X(l, ge))
                },
                me = e => {
                    h(l), l._msTout = setTimeout(() => {
                        if (l._msTout) {
                            const {
                                clientHeight: t,
                                clientWidth: o
                            } = $, {
                                scrollLeft: r,
                                scrollWidth: n
                            } = V, {
                                scrollTop: s,
                                scrollHeight: a
                            } = k;
                            let i, d;
                            null !== de && (de ? s + t < a && (i = s + ne * Nt) : s && (i = s - ne * Nt)), null !== ce && (ce ? r + o < n && (d = r + se * Nt) : r && (d = r - se * Nt)), Ke(d) || Ke(i) ? (l.scrollTo(d, i), me(e), pe(e)) : h(l)
                        }
                    }, 50)
                };
            document.onmousemove = e => {
                m(e);
                const {
                    clientY: t,
                    clientX: o
                } = e, {
                    clientHeight: r,
                    clientWidth: n
                } = $, {
                    offsetTop: a,
                    offsetLeft: i
                } = ye(e, l, s, S, E, ee, Q, V, k), d = C($), c = d.top, f = d.left, u = j + q + i, g = K + G + a;
                let p;
                de = null, ce = null, ae = t, ie = o, ae < c ? (p = !0, de = !1, ne = c - ae) : ae > c + r && (p = !0, de = !0, ne = ae - c - r), ie < f ? (p = !0, ce = !1, se = f - ie) : ie > f + n && (p = !0, ce = !0, se = ie - f - n), u < j ? g > K && g < K + G && (re = "left") : u > j + q ? g > K && g < K + G && (re = "right") : g < K ? re = "top" : g > K + G && (re = "bottom"), p ? !l._msTout && me(e) : h(l), pe(e)
            }, document.onmouseup = () => {
                document.onmousemove = n, document.onmouseup = a, h(l), A(d, "drag--extend-range");
                const e = H(l, fe, ge),
                    o = B(l, he, ge);
                ue(l, e, o) ? (i.rows = e, i.cols = o) : x && x[Yt]({
                    message: u(l, "vxe.pro.area.extendErr"),
                    status: Wt,
                    id: Ot
                }), qe(i, X(l, i)), v(Z), Pe(l, t, O, L, i), l._isCAEd = !1, l[Xt]("cell-area-extension-end", {
                    rows: i.rows,
                    cols: i.cols,
                    targetRows: O,
                    targetCols: L
                }, t)
            }, R(d, "drag--extend-range"), l._isCAEd = !0, l[Xt]("cell-area-extension-start", r, t)
        }
    }

    function Ue(t, l, r) {
        const {
            button: n
        } = t, s = 2 === n;
        if (!(0 === n || s)) return;
        const {
            $el: a,
            $refs: i,
            editStore: d,
            editOpts: c,
            _isCAEd: f
        } = l, {
            actived: u
        } = d, {
            fixed: g,
            row: E,
            column: I,
            cell: T
        } = r;
        if (f) return void p(t);
        if (u.row === E && ("cell" === c.mode ? u.column === I : "row" === c.mode)) return;
        const $ = t.ctrlKey,
            F = t.shiftKey,
            M = T.offsetTop,
            k = T.offsetLeft,
            V = T.offsetWidth,
            W = T.offsetHeight;
        let N = l[Gt]();
        const P = l[qt]();
        if (h(l), !s && F && P) return void Re(t, l, P, N, r);
        if (l.clearActived(t), l.clearSelected(), !s || !ut(N, e => Qe(e.rows, E) && Qe(e.cols, I))) {
            $ || (N = [], l[jt]());
            const n = document.onmousemove,
                d = document.onmouseup,
                c = t.clientX,
                f = t.clientY,
                {
                    tableBody: u,
                    rightBody: p,
                    tableFooter: F
                } = i,
                P = D(t, T),
                Y = u.$el,
                U = p ? p.$el : null,
                K = F ? F.$el : null,
                j = U || Y,
                q = K || Y,
                G = b(l, I.fixed),
                z = w(G, ".vxe-table--cell-area"),
                J = z.children,
                Z = J[0],
                Q = J[2],
                ee = J[3],
                te = T.parentNode,
                le = w(G, ".vxe-body--row"),
                oe = le.firstChild,
                re = j.scrollTop,
                ne = "left" === g ? 0 : q.scrollLeft;
            let se = null,
                ae = null,
                ie = 1,
                de = 1,
                ce = 0,
                fe = 0;
            const ue = {
                    el: null,
                    type: $ ? Ft : It,
                    cols: [],
                    rows: [],
                    top: 0,
                    left: 0,
                    width: 0,
                    height: 0
                },
                he = {
                    el: null,
                    type: Dt,
                    area: ue,
                    column: I,
                    row: E,
                    top: T.offsetTop,
                    left: T.offsetLeft,
                    width: T.offsetWidth,
                    height: T.offsetHeight
                };
            if ($) {
                const e = g ? `${g}El` : "el",
                    t = rt(N, e => e.type === It);
                t && (t.type = Ft, t[e] = S(ee), y(t[e], t)), ue[e] = S(ee)
            }
            l[zt](he), N.push(ue), l.activeCellArea = he;
            const ge = t => {
                    const {
                        offsetTop: r,
                        offsetLeft: n
                    } = ye(t, l, g, c, f, ne, re, q, j), s = q.scrollWidth, a = j.scrollHeight, i = 0 <= r, d = 0 <= n;
                    let u, h, p = e(r),
                        m = e(n);
                    i ? (u = L(l, E, I, te, i, p + P.offsetY), p = o(a - M, u.moveHeight)) : (u = L(l, E, I, te, i, p - P.offsetY), p = o(M + W, u.moveHeight)), d ? (h = _(l, E, I, T, d, m + P.offsetX), m = o(s - k, h.moveWidth)) : (h = _(l, E, I, T, d, m - P.offsetX), m = o(k + V, h.moveWidth));
                    const {
                        rows: w,
                        cols: C
                    } = O(l, u.rows, h.cols);
                    ue.rows = w, ue.cols = C, v(Q), $ ? (v(Z), x(ee)) : (v(ee), x(Z)), qe(ue, X(l, ue))
                },
                pe = e => {
                    h(l), l._msTout = setTimeout(() => {
                        if (l._msTout) {
                            const {
                                clientHeight: t,
                                clientWidth: o
                            } = Y, {
                                scrollLeft: r,
                                scrollWidth: n
                            } = q, {
                                scrollTop: s,
                                scrollHeight: a
                            } = j;
                            let i, d;
                            null !== se && (se ? s + t < a && (i = s + ie * Nt) : s && (i = s - ie * Nt)), null !== ae && (ae ? r + o < n && (d = r + de * Nt) : r && (d = r - de * Nt)), Ke(d) || Ke(i) ? (l.scrollTo(d, i), pe(e), ge(e)) : h(l)
                        }
                    }, 50)
                };
            s || (document.onmousemove = e => {
                m(e);
                const {
                    clientY: t,
                    clientX: o
                } = e, {
                    clientHeight: r,
                    clientWidth: n
                } = Y, s = C(Y), a = s.top, i = s.left;
                let d;
                se = null, ae = null, ce = t, fe = o, ce < a ? (d = !0, se = !1, ie = a - ce) : ce > a + r && (d = !0, se = !0, ie = ce - a - r), fe < i ? (d = !0, ae = !1, de = i - fe) : fe > i + n && (d = !0, ae = !0, de = fe - i - n), d ? !l._msTout && pe(e) : h(l), ge(e)
            }), document.onmouseup = () => {
                document.onmousemove = n, document.onmouseup = d, h(l), ue.cols = B(l, oe, ue), ue.rows = H(l, le, ue), A(a, "drag--area"), l[Xt]("cell-area-selection-end", {
                    rows: ue.rows,
                    cols: ue.cols
                }, t)
            }, R(a, "drag--area"), ge(t), l.cellAreas = N, l[Xt]("cell-area-selection-start", r, t)
        }
    }
    const {
        uniqueId: Xe,
        isNumber: Ke,
        browse: je,
        assign: qe,
        slice: Ge,
        isObject: ze,
        isBoolean: Je,
        indexOf: Ze,
        includes: Qe,
        eachTree: et,
        arrayEach: tt,
        hasOwnProp: lt,
        toInteger: ot,
        find: rt,
        findLast: nt,
        findLastIndexOf: st,
        findIndexOf: at,
        toNumber: it,
        toValueString: dt,
        toFormatString: ct,
        filter: ft,
        some: ut,
        get: ht,
        set: gt,
        first: pt,
        last: mt,
        map: wt,
        isArray: Ct,
        toStringJSON: xt
    } = XEUtils, vt = window, Rt = je(), At = "\r\n", bt = "WEUwMDAwMTcX3", St = ["JTdCJTIya2V", "5JTIyJTNBJT", "Iya29tY2t6Z3h1", "Z2lobnVjY", "yUyMiUyQy", "UyMm0lMjIlM0E", "lNUIlNUQlMkMlM", "jJzJTIyJT", "NBJTVCJTVEJTJD", "JTIyaSUyMiUzQS", "U1QiUyMj", "EwLiouKi4qJTI", "yJTJDJTIyMTcyLj", "E2LiouKiUyMiU", "yQyUyMjE", "5Mi4xNjguKi4q", "JTIyJTVEJTdE"].join("");
    let Et = !1;
    const yt = vt[`a${Et?"":"to"}b`],
        It = "main",
        Tt = "copy",
        $t = "extend",
        Ft = "multi",
        Dt = "active",
        Mt = {
            F2: "F2",
            ESCAPE: "Escape",
            ENTER: "Enter",
            TAB: "Tab",
            DELETE: "Delete",
            BACKSPACE: "Backspace",
            SPACEBAR: " ",
            CONTEXT_MENU: "ContextMenu",
            ARROW_UP: "ArrowUp",
            ARROW_DOWN: "ArrowDown",
            ARROW_LEFT: "ArrowLeft",
            ARROW_RIGHT: "ArrowRight",
            PAGE_UP: "PageUp",
            PAGE_DOWN: "PageDown",
            A: "a",
            X: "x",
            C: "c",
            V: "v",
            F: "f",
            H: "h",
            M: "m"
        };
    let kt = !1;
    const Vt = {
            " ": "Spacebar",
            Apps: Mt.CONTEXT_MENU,
            Del: Mt.DELETE,
            Up: Mt.ARROW_UP,
            Down: Mt.ARROW_DOWN,
            Left: Mt.ARROW_LEFT,
            Right: Mt.ARROW_RIGHT
        },
        Ot = "operErr",
        Wt = "error",
        Nt = 4,
        Lt = "seq",
        _t = "checkbox",
        Bt = "radio",
        Ht = yt ? "$nextTick" : "",
        Pt = kt ? "" : "Event",
        Yt = Pt ? "message" : "",
        Ut = Yt ? "setData" : "",
        Xt = Yt ? "emit" + Pt : "",
        Kt = Xt ? "setCellAreas" : "",
        jt = Kt ? "clearCellAreas" : "",
        qt = jt ? "getActiveCellArea" : "",
        Gt = qt ? "getCellAreas" : "",
        zt = Gt ? "setActiveCellArea" : "",
        Jt = zt ? "scrollToRow" : "",
        Zt = Jt ? "scrollToColumn" : "",
        Qt = Zt ? "clearCopyCellArea" : "",
        el = vt[yt("Y29uc29sZQ==")],
        tl = {
            children: "children"
        },
        ll = vt[yt("ZGVjb2RlVVJJQ29tcG9uZW50")],
        ol = ["%5Bvx", "e-table%20P", "RO%20%", "E6%9C%A", "A%E6%8E%88%", "E6%9D%83%5D", "%20%E5%A6%82", "%E9%9C%80%E8%", "8E%B7%E5%8F%96", "%E6%8E%88%E6%9D%83%EF%", "BC%8C%E8%AF%B7%E5%", "88%B0%E5%AE%98%", "E7%BD%91%20h", "tt", "ps%3A%2F%2Fx-e", "xtends.gi", "thu", "b.io%2Fvx", "e-table%2Fpl", "ugins%2F%20%E8%", "B4%AD%E4%B9%B0%E6", "%8E%88%E6%9D%83%E6%88%96%E", "8%81%94%E7%B3%BB%", "E9%82%AE%E4%", "BB%B6%20x_ext", "ends%4016", "3.co", "m%20%E5%92%A8", "%E8%AF%A2"],
        rl = "\t",
        nl = vt[yt("bG9jYXRpb24=")],
        sl = () => {
            return true;
        };
    vt.VXETableMixin = {
        data() {
            return {
                fnrStore: {
                    visible: !1,
                    activeTab: "",
                    findValue: "",
                    replaceValue: "",
                    isRE: !1,
                    isWhole: !1,
                    isSensitive: !1,
                    showREErr: !1,
                    showCount: !1,
                    findCount: 0
                },
                fnrSearchList: [],
                fnrTabs: [{
                    value: "find",
                    label: "vxe.pro.fnr.tabs.find"
                }, {
                    value: "replace",
                    label: "vxe.pro.fnr.tabs.replace"
                }],
                azIndex: 0,
                fnrActiveModal: null
            }
        },
        mounted() {
            const {
                $el: e
            } = this, t = sl();
            Et || (Et = t), t && e && e.setAttribute("pro-auth", bt), kt = t, setTimeout(n, 3e3)
        },
        beforeDestroy() {
            const {
                $el: e,
                fnrActiveModal: t
            } = this;
            e && e.removeAttribute("pro-auth"), t && t.close()
        },
        methods: {
            handleHeaderCellAreaEvent(e, t) {
                const {
                    mouseConfig: l,
                    mouseOpts: o,
                    afterFullData: r,
                    areaOpts: n
                } = this, {
                    triggerFilter: s,
                    column: a
                } = t;
                l && o.area && (s ? this[Qt]() : (!n || !1 !== n.selectCellByHeader) && (r.length ? (this.clearActived(), setTimeout(() => {
                    const l = pt(r),
                        o = [];
                    et([a], e => {
                        e.children && e.children.length || o.push(e)
                    }, tl);
                    const n = pt(o),
                        s = mt(o);
                    this[Ht](() => {
                        this[Qt](), this[Kt]([{
                            type: It,
                            startColumn: n,
                            endColumn: s,
                            startRow: l,
                            endRow: mt(r)
                        }], {
                            column: n,
                            row: l
                        })
                    }), this[Jt](l, n), this[Xt]("header-cell-area-selection", qe({
                        targetRows: Ge(r, 0),
                        targetCols: o
                    }, t), e)
                }, 10)) : (this[jt](), this[Qt]())))
            },
            handleUpdateCellAreas() {
                const {
                    scrollXLoad: e,
                    scrollYLoad: t
                } = this, l = this[Gt](), o = this[qt]();
                if (l.length && o) {
                    const r = () => {
                        Ne(this, l, o)
                    };
                    e || t ? (setTimeout(r, 40), setTimeout(r, 100)) : setTimeout(r, 0)
                }
            },
            [`_${Gt}`]() {
                return this.cellAreas || []
            },
            [`_${jt}`](e) {
                const t = this[Gt]();
                let l = e;
                if (Ke(e) && (l = t[e]), l && 1 < t.length) {
                    const {
                        el: e
                    } = l, o = this[qt]();
                    e && e.parentNode && e.parentNode.removeChild(e);
                    const r = t.filter(e => e !== l);
                    if (this.cellAreas = r, o && o.area === l) {
                        const e = mt(r);
                        this[zt]({
                            area: e,
                            row: mt(e.rows),
                            column: mt(e.cols)
                        })
                    }
                } else I(this, e => {
                    const t = e.children,
                        l = t[0],
                        o = t[2],
                        r = t[3],
                        n = t[4];
                    if (v(l), v(l.firstChild), v(o), v(n), r) {
                        const e = r.children;
                        for (let t = e.length - 1; 0 <= t; t--) r.removeChild(e[t])
                    }
                }), this.activeCellArea = null, this.cellAreas = [];
                return this[Ht]()
            },
            _getCopyCellArea() {
                return this.copyAreaMpas || null
            },
            [`_${[Qt]}`]() {
                return T(this, Tt), this.copyAreaMpas = null, this[Ht]()
            },
            [`_${Kt}`](e, t) {
                if (e) {
                    Ct(e) || (e = [e]), this[jt]();
                    let l = rt(e, e => e.type === It),
                        o = [];
                    if (l || (l = rt(e, e => !e.type), l && (l.type = It)), l) {
                        const e = K(this, l);
                        o = e ? [e] : []
                    } else {
                        const t = [];
                        tt(e, e => {
                            const l = K(this, e);
                            l && t.push(l)
                        }), o = t
                    }
                    if (o.length) {
                        const l = o[0];
                        let r, n, s = o[0];
                        if (t) {
                            const {
                                area: a,
                                row: i,
                                column: d
                            } = t;
                            Ke(a) ? s = o[a] : a && (s = o[Ze(e, a)] || l), r = Ke(i) ? s.rows[i] : i, n = Ke(d) ? s.cols[d] : d
                        }
                        this[zt]({
                            area: s,
                            row: r || mt(s.rows),
                            column: n || mt(s.cols)
                        })
                    }
                    this.cellAreas = o
                }
                return this[Ht]()
            },
            [`_${zt}`](e) {
                return T(this, Dt), this.activeCellArea = Y(this, qe({}, e, {
                    type: Dt
                })), this[Ht]()
            },
            [`_${qt}`]() {
                return this.activeCellArea || null
            },
            handleKeyboardEvent(e) {
                Le(e, this)
            },
            _openFind() {
                const {
                    fnrTabs: e,
                    fnrOpts: t
                } = this;
                return t.isFind ? Oe(this, e[0]) : this[Ht]()
            },
            _openReplace() {
                const {
                    fnrTabs: e,
                    fnrOpts: t = {}
                } = this;
                return t.isReplace ? Oe(this, e[1]) : this[Ht]()
            },
            _closeFNR() {
                const {
                    fnrActiveModal: e
                } = this;
                e && e.close();
                const {
                    fnrStore: t
                } = this;
                return t.visible = !1, t.showCount = !1, this.fnrSearchList = [], this.fnrActiveModal = !1, this[Ht]()
            },
            triggerFNROpenEvent(e, t) {
                const {
                    fnrStore: l,
                    fnrTabs: o,
                    fnrOpts: r
                } = this, n = rt(o, e => e.value === t) || o[0];
                ("find" !== n.value || !r.isFind) && ("replace" !== n.value || !r.isReplace) || (Oe(this, n), this[Xt]("open-fnr", {
                    tab: l.activeTab
                }, e))
            },
            triggerFNRTabChangeEvent(e, t) {
                const {
                    fnrStore: l
                } = this;
                l.activeTab !== t.value && (l.activeTab = t.value, De(this), this[Xt]("change-fnr", {
                    tab: l.activeTab
                }, e), this[Xt]("fnr-change", {
                    tab: l.activeTab
                }, e))
            },
            triggerFNRFindKeydownEvent(e) {
                const {
                    $event: t
                } = e, l = d(t, Mt.ENTER);
                l && ("replace" === this.fnrStore.activeTab ? this.triggerFNRReplaceEvent(t) : this.triggerFNRFindEvent(t))
            },
            triggerFNRFindEvent(e) {
                const {
                    $xegrid: t,
                    $vxe: l,
                    fnrStore: o,
                    fnrOpts: r
                } = this, {
                    modal: n
                } = l, {
                    beforeFindMethod: s,
                    afterFindMethod: a
                } = r, i = !1, d = dt(o.findValue);
                if (!o.showREErr && !(s && !1 === s({
                        isAll: i,
                        findValue: d,
                        $table: this,
                        $grid: t
                    }))) {
                    const l = Me(this);
                    if (ke(this), l.length) {
                        const o = l[0];
                        a && a({
                            isAll: i,
                            findValue: d,
                            result: wt(l, e => ({
                                row: e.offsetRow,
                                _rowIndex: e._rowIndex,
                                column: e.offsetColumn,
                                _columnIndex: e._columnIndex
                            })),
                            $table: this,
                            $grid: t
                        }), this[Xt]("fnr-find", {
                            findValue: d,
                            row: o.offsetRow,
                            column: o.offsetColumn
                        }, e)
                    } else n && n[Yt]({
                        message: u(this, "vxe.pro.fnr.notCell"),
                        status: "warning",
                        id: "operWarn"
                    })
                }
            },
            triggerFNRFindAllEvent(e) {
                const {
                    $xegrid: t,
                    $vxe: l,
                    fnrStore: o,
                    fnrOpts: r
                } = this, {
                    modal: n
                } = l, {
                    beforeFindMethod: s,
                    afterFindMethod: a
                } = r, i = !0, d = dt(o.findValue);
                if ((this.fnrSearchList = [], !o.showREErr) && !(s && !1 === s({
                        isAll: i,
                        findValue: d,
                        $table: this,
                        $grid: t
                    }))) {
                    const l = Me(this, !0);
                    if (o.findCount = l.length, o.showCount = !0, l.length) {
                        const o = [],
                            r = wt(l, (e, t) => {
                                const {
                                    offsetRow: l,
                                    offsetColumn: r,
                                    _rowIndex: n,
                                    _columnIndex: s
                                } = e, a = dt(ht(l, r.property));
                                return o.push({
                                    row: l,
                                    _rowIndex: n,
                                    column: r,
                                    _columnIndex: s
                                }), {
                                    seq: t + 1,
                                    row: n,
                                    col: s,
                                    isActived: !1,
                                    value: a || u(this, "vxe.pro.fnr.empty")
                                }
                            });
                        setTimeout(() => {
                            this.fnrSearchList = r, a && a({
                                isAll: i,
                                findValue: d,
                                result: o,
                                $table: this,
                                $grid: t
                            })
                        }, 10), this[Xt]("fnr-find-all", {
                            findValue: d,
                            result: o
                        }, e)
                    } else n && n[Yt]({
                        message: u(this, "vxe.pro.fnr.notCell"),
                        status: "warning",
                        id: "operWarn"
                    })
                }
            },
            triggerFNRItemEvent(e, t) {
                const {
                    afterFullData: l,
                    visibleColumn: o
                } = this, r = l[t.row], n = o[t.col];
                r && n && (ke(this), t.isActived = !0, this[Jt](r, n), this[Kt]([{
                    type: It,
                    startRow: r,
                    endRow: r,
                    startColumn: n,
                    endColumn: n
                }]))
            },
            triggerFNRReplaceKeydownEvent(e) {
                const {
                    $event: t
                } = e, l = d(t, Mt.ENTER);
                l && this.triggerFNRReplaceEvent(t)
            },
            triggerFNRReplaceEvent(e) {
                const {
                    $xegrid: t,
                    $vxe: l,
                    fnrStore: o,
                    fnrOpts: r,
                    afterFullData: n,
                    visibleColumn: s
                } = this, {
                    modal: a
                } = l, i = !1, d = this[qt](), c = dt(o.findValue), f = dt(o.replaceValue);
                if (Ie(this, c) && (c || f))
                    if (d) {
                        const {
                            beforeReplaceMethod: l,
                            replaceMethod: o,
                            afterReplaceMethod: h
                        } = r, {
                            row: g,
                            column: p
                        } = d;
                        if (l && !1 === l({
                                isAll: i,
                                findValue: c,
                                replaceValue: f,
                                $table: this,
                                $grid: t
                            })) return;
                        Te(this, g, p, c) ? (o ? o({
                            row: g,
                            column: p,
                            cellValue: f
                        }) : gt(g, p.property, f), Me(this), ke(this), h && h({
                            isAll: i,
                            findValue: c,
                            replaceValue: f,
                            result: [{
                                row: g,
                                _rowIndex: Ze(n, g),
                                column: p,
                                _columnIndex: Ze(s, p)
                            }],
                            $table: this,
                            $grid: t
                        }), this[Xt]("fnr-replace", {
                            findValue: c,
                            replaceValue: f,
                            row: g,
                            column: p
                        }, e)) : a && a[Yt]({
                            message: u(this, "vxe.pro.fnr.notCell"),
                            status: "warning",
                            id: "operWarn"
                        })
                    } else a && a[Yt]({
                        message: u(this, "vxe.pro.fnr.notCell"),
                        status: "warning",
                        id: "operWarn"
                    })
            },
            triggerFNRReplaceAllEvent(e) {
                const {
                    $xegrid: t,
                    $vxe: l,
                    fnrStore: o,
                    fnrOpts: r
                } = this, {
                    modal: n
                } = l, s = !0, a = dt(o.findValue), i = dt(o.replaceValue);
                if (a || i) {
                    const {
                        beforeReplaceMethod: l,
                        replaceMethod: d,
                        afterReplaceMethod: c
                    } = r;
                    if (o.showREErr) return;
                    if (l && !1 === l({
                            isAll: s,
                            findValue: a,
                            replaceValue: i,
                            $table: this,
                            $grid: t
                        })) return;
                    const f = Me(this, !0);
                    if (ke(this), f.length) {
                        const l = [];
                        tt(f, e => {
                            const {
                                offsetRow: t,
                                _rowIndex: o,
                                offsetColumn: r,
                                _columnIndex: n
                            } = e;
                            d ? d({
                                row: t,
                                column: r,
                                cellValue: i
                            }) : gt(t, r.property, i), l.push({
                                row: t,
                                _rowIndex: o,
                                column: r,
                                _columnIndex: n
                            })
                        }), c && c({
                            isAll: s,
                            findValue: a,
                            replaceValue: i,
                            result: l,
                            $table: this,
                            $grid: t
                        }), this[Xt]("fnr-replace-all", {
                            findValue: a,
                            replaceValue: i,
                            result: l
                        }, e), n && n[Yt]({
                            message: u(this, "vxe.pro.fnr.replaceSuccess", [f.length]),
                            status: "success",
                            id: "operEnd"
                        })
                    } else n && n[Yt]({
                        message: u(this, "vxe.pro.fnr.notCell"),
                        status: "warning",
                        id: "operWarn"
                    })
                }
            },
            handleCopyCellAreaEvent(e) {
                const {
                    clipOpts: t
                } = this;
                if (!1 !== t.isCopy && Z(this)) {
                    const t = e.clipboardData;
                    if (t) {
                        const l = ee(this, e, !1),
                            {
                                text: o,
                                html: r,
                                status: n
                            } = l;
                        t[Ut]("text/plain", o), t[Ut]("text/html", r), n && Q(this, l, !1)
                    }
                }
            },
            handleCutCellAreaEvent(e) {
                const {
                    clipOpts: t
                } = this;
                if (bt && !1 !== t.isCut && Z(this)) {
                    const t = e.clipboardData;
                    if (t) {
                        const l = ee(this, e, !0),
                            {
                                text: o,
                                html: r,
                                status: n
                            } = l;
                        t[Ut]("text/plain", o), t[Ut]("text/html", r), n && Q(this, l, !0)
                    }
                }
            },
            handlePasteCellAreaEvent(e) {
                const {
                    clipOpts: t
                } = this;
                if (bt && !1 !== t.isPaste && Z(this)) {
                    const t = e.clipboardData;
                    if (t) {
                        const l = t.getData("text/plain");
                        l && se(this, e, {
                            text: l
                        })
                    }
                }
            },
            _copyCellArea() {
                return ae(this, null)
            },
            _cutCellArea() {
                return ie(this, null)
            },
            _pasteCellArea() {
                return de(this, null)
            },
            triggerCellExtendMousedownEvent(e, t) {
                s() && Ye(e, this, t)
            },
            handleCellAreaEvent(e, t) {
                s() && Ue(e, this, t)
            },
            triggerCopyCellAreaEvent(e) {
                s() && ae(this, e)
            },
            triggerCutCellAreaEvent(e) {
                s() && ie(this, e)
            },
            triggerPasteCellAreaEvent(e) {
                s() && de(this, e)
            }
        }
    }
})();